Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin
Znav
nextThe C++ generateUUID Function
prevThe C++ Cache Template

This class is at the root of the derivation tree for Ice exceptions and encapsulates functionality that is common to all Ice and IceUtil exceptions:

Wiki Markup
{zcode:cpp}
class Exception : public std::exception {
public:
    Exception();
    Exception(const char* file, int line);
    virtual ~Exception() throw();

    virtual std::string ice_name() const;
    virtual void ice_print(std::ostream&) const;
    virtual const char* what() const throw();
    virtual Exception* ice_clone() const;
    virtual void ice_throw() const;
    const char* ice_file() const;
    int ice_line() const;
};
{zcode}

The second constructor stores a file name and line number in the exception that are returned by the ice_file and ice_line member functions, respectively. This allows you to identify the source of an exception by passing the __FILE__ and __LINE__ preprocessor macros to the constructor.

The what member function is a synonym for ice_print. The default implementation of ice_print prints the file name, line number, and the name of the exception.

The remaining member functions are described in the C++ Mapping for Exceptions.

Ztop
See Also
Zret
Znav
nextThe C++ generateUUID Function
prevThe C++ Cache Template