barrier/lib/net/XNetwork.h

81 lines
1.7 KiB
C
Raw Normal View History

#ifndef XNETWORK_H
#define XNETWORK_H
#include "XBase.h"
#include "CString.h"
//! Generic network exception
/*!
Network exceptions are thrown when initializing the network subsystem
and not during normal network use.
*/
class XNetwork : public XBase { };
//! Network subsystem not available exception
/*!
Thrown when the network subsystem is unavailable, typically because
the necessary shared library is unavailable.
*/
class XNetworkUnavailable : public XNetwork {
2002-04-29 14:40:01 +00:00
protected:
// XBase overrides
virtual CString getWhat() const throw();
};
//! Network subsystem failed exception
/*!
Thrown when the network subsystem cannot be initialized.
*/
class XNetworkFailed : public XNetwork {
2002-04-29 14:40:01 +00:00
protected:
// XBase overrides
virtual CString getWhat() const throw();
};
//! Network subsystem vesion unsupported exception
/*!
Thrown when the network subsystem has a version incompatible with
what's expected.
*/
class XNetworkVersion : public XNetwork {
2002-04-29 14:40:01 +00:00
public:
XNetworkVersion(int major, int minor) throw();
//! @name accessors
//@{
//! Get the network subsystem's major version
int getMajor() const throw();
//! Get the network subsystem's minor version
int getMinor() const throw();
//@}
2002-04-29 14:40:01 +00:00
protected:
// XBase overrides
virtual CString getWhat() const throw();
2002-04-29 14:40:01 +00:00
private:
int m_major;
int m_minor;
};
//! Network subsystem incomplete exception
/*!
Thrown when the network subsystem is missing an expected and required
function.
*/
class XNetworkFunctionUnavailable : public XNetwork {
2002-04-29 14:40:01 +00:00
public:
XNetworkFunctionUnavailable(const char* name) throw();
2002-04-29 14:40:01 +00:00
protected:
// XBase overrides
virtual CString getWhat() const throw();
2002-04-29 14:40:01 +00:00
private:
CString m_name;
};
#endif