HFST - Helsinki Finite-State Transducer Technology - C++ API  version 3.9.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Macros
HfstExceptionDefs.h File Reference

A file for exceptions. More...

#include <string>
#include <sstream>
#include "hfstdll.h"

Go to the source code of this file.

Classes

struct  ContextTransducersAreNotAutomataException
 Context transducers are not automata. More...
 
struct  EmptySetOfContextsException
 The set of transducer pairs is empty. More...
 
struct  EndOfStreamException
 The stream is at end. More...
 
struct  FunctionNotImplementedException
 Function has not been implemented (yet). More...
 
struct  HfstException
 Base class for HfstExceptions. Holds its own name and the file and line number where it was thrown. More...
 
struct  HfstFatalException
 An error happened probably due to a bug in the HFST code. More...
 
struct  HfstTransducerTypeMismatchException
 Two or more HfstTransducers are not of the same type. More...
 
struct  ImplementationTypeNotAvailableException
 The library required by the implementation type requested is not linked to HFST. More...
 
struct  IncorrectUtf8CodingException
 String is not valid utf-8. More...
 
struct  MissingOpenFstInputSymbolTableException
 An OpenFst transducer does not have an input symbol table. More...
 
struct  NotTransducerStreamException
 The stream does not contain transducers. More...
 
struct  NotValidAttFormatException
 The stream is not in valid AT&T format. More...
 
struct  StateIndexOutOfBoundsException
 The StateId argument is not valid. More...
 
struct  StateIsNotFinalException
 State is not final (and cannot have a final weight). More...
 
struct  StreamCannotBeWrittenException
 Stream cannot be written. More...
 
struct  StreamIsClosedException
 Stream is closed. More...
 
struct  StreamNotReadableException
 Stream cannot be read. More...
 
struct  TransducerHasWrongTypeException
 Transducer has wrong type. More...
 
struct  TransducerHeaderException
 Transducer has a malformed HFST header. More...
 
struct  TransducerIsCyclicException
 Transducer is cyclic. More...
 
struct  TransducersAreNotAutomataException
 Transducers are not automata. More...
 
struct  TransducerTypeMismatchException
 Two or more transducers do not have the same type. More...
 

Macros

#define HFST_CATCH(E)
 Macro to catch exceptions thrown with HFST_THROW. More...
 
#define HFST_EXCEPTION_CHILD_DECLARATION(CHILD)
 Declare a subclass of HfstException of type CHILD. More...
 
#define HFST_EXCEPTION_CHILD_DEFINITION(CHILD)
 Define a subclass of HfstException of type CHILD. More...
 
#define HFST_THROW(E)
 Macro to throw an exception of type E. Use THROW instead of regular throw with subclasses of HfstException. More...
 
#define HFST_THROW_MESSAGE(E, M)
 Macro to throw an exception of type E with message M. Use THROW instead of regular throw with subclasses of HfstException. More...
 

Detailed Description

A file for exceptions.

Macro Definition Documentation

#define HFST_CATCH (   E)
Value:
catch (const E &e) \
{ \
std::cerr << e.file << ", line " << e.line << ": " << \
e() << std::endl; \
}

Macro to catch exceptions thrown with HFST_THROW.

#define HFST_EXCEPTION_CHILD_DECLARATION (   CHILD)
Value:
struct CHILD : public HfstException \
{ CHILD(const std::string &name,const std::string &file,size_t line); }
Base class for HfstExceptions. Holds its own name and the file and line number where it was thrown...
Definition: HfstExceptionDefs.h:26

Declare a subclass of HfstException of type CHILD.

#define HFST_EXCEPTION_CHILD_DEFINITION (   CHILD)
Value:
CHILD::CHILD \
(const std::string &name,const std::string &file,size_t line):\
HfstException(name,file,line)\
{}
Base class for HfstExceptions. Holds its own name and the file and line number where it was thrown...
Definition: HfstExceptionDefs.h:26

Define a subclass of HfstException of type CHILD.

#define HFST_THROW (   E)
Value:
do { \
hfst_set_exception(std::string(#E)); \
throw E(#E,__FILE__,__LINE__); } \
while(false)

Macro to throw an exception of type E. Use THROW instead of regular throw with subclasses of HfstException.

#define HFST_THROW_MESSAGE (   E,
 
)
Value:
do { \
hfst_set_exception(std::string(#E)); \
throw E(std::string(#E)+": "+std::string(M) \
,__FILE__,__LINE__); } \
while(false)

Macro to throw an exception of type E with message M. Use THROW instead of regular throw with subclasses of HfstException.