barrier/lib/net/XNetwork.h

95 lines
2.2 KiB
C
Raw Normal View History

2002-08-02 23:57:46 +04:00
/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2002 Chris Schoeneman
*
* This package is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* found in the file COPYING that should have accompanied this file.
*
* This package is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#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 18:40:01 +04: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 18:40:01 +04: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 18:40:01 +04: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 18:40:01 +04:00
protected:
// XBase overrides
virtual CString getWhat() const throw();
2002-04-29 18:40:01 +04: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 18:40:01 +04:00
public:
XNetworkFunctionUnavailable(const char* name) throw();
2002-04-29 18:40:01 +04:00
protected:
// XBase overrides
virtual CString getWhat() const throw();
2002-04-29 18:40:01 +04:00
private:
CString m_name;
};
#endif