370 lines
11 KiB
C++
370 lines
11 KiB
C++
/*
|
|
* File: Exception.h
|
|
* Author: jgaebler
|
|
*
|
|
* Created on May 6, 2010, 9:44 AM
|
|
*/
|
|
#pragma once
|
|
|
|
#ifndef UBEEME_EXCEPTION_H
|
|
#define UBEEME_EXCEPTION_H
|
|
|
|
#include "common/Defines.h"
|
|
|
|
#include <exception>
|
|
|
|
namespace ubeeme {
|
|
namespace moversight {
|
|
|
|
/**
|
|
* @class Exception
|
|
* @brief Defines a set of exceptions, used within Moversight.
|
|
* @ingroup Moversight
|
|
* @author Jan Gäbler
|
|
*/
|
|
class Exception : public std::exception {
|
|
public:
|
|
|
|
/**
|
|
* @brief Constructor
|
|
* @param message the exception message - what has happened
|
|
*/
|
|
Exception(const char* message) {
|
|
m = message;
|
|
}
|
|
|
|
/**
|
|
* @brief Destructor
|
|
*/
|
|
virtual
|
|
~Exception() throw () {
|
|
};
|
|
|
|
/**
|
|
* @brief A Java style toString implementation. Returns, what has happened.
|
|
* @return What has happened.
|
|
*/
|
|
const char*
|
|
toString() {
|
|
return what();
|
|
}//End toString
|
|
|
|
/**
|
|
* @brief Overrides the standard what method and tells, what has happened.
|
|
* @return What has happened.
|
|
*/
|
|
virtual const char*
|
|
what() const throw () {
|
|
return m.c_str();
|
|
}
|
|
|
|
protected:
|
|
/**
|
|
* @brief Stores the exeption message.
|
|
*/
|
|
std::string m;
|
|
|
|
private:
|
|
Exception();
|
|
};
|
|
|
|
/**
|
|
* @brief Defines a null pointer expception. Used to signal a null pointer error during the execution.
|
|
* @author Jan Gäbler
|
|
* @ingroup Moversight
|
|
* @class NullPointerException
|
|
*/
|
|
class NullPointerException : public Exception {
|
|
public:
|
|
|
|
/**
|
|
* @brief Constructor
|
|
* @param message what has happened?
|
|
*/
|
|
NullPointerException(const char* message) : Exception(message) {
|
|
}
|
|
};
|
|
|
|
/**
|
|
* @brief Defines a logic expception. Used to signal a logical error during the execution.
|
|
* @author Jan Gäbler
|
|
* @ingroup Moversight
|
|
* @class LogicException
|
|
*/
|
|
class LogicException : public Exception {
|
|
public:
|
|
|
|
/**
|
|
* @brief Constructor
|
|
* @param message what has happened?
|
|
*/
|
|
LogicException(const char* message) : Exception(message) {
|
|
}
|
|
};
|
|
|
|
/**
|
|
* @brief Defines a not implemented yet expception. Used to signal not implemented methods.
|
|
* @author Jan Gäbler
|
|
* @ingroup Moversight
|
|
* @class NotImplementedYetException
|
|
*/
|
|
class NotImplementedYetException : public Exception {
|
|
public:
|
|
|
|
/**
|
|
* @brief Constructor
|
|
* @param message what has happened?
|
|
*/
|
|
NotImplementedYetException(const char* message) : Exception(message) {
|
|
}
|
|
};
|
|
|
|
/**
|
|
* @brief Defines an index out of bounce exception. Used to signal index errors.
|
|
* @author Jan Gäbler
|
|
* @ingroup Moversight
|
|
* @class IndexOutOfBounceException
|
|
*/
|
|
class IndexOutOfBounceException : public Exception {
|
|
public:
|
|
|
|
/**
|
|
* @brief Constructor
|
|
*
|
|
* @param message What has happened?
|
|
*/
|
|
IndexOutOfBounceException(const char* message) : Exception(message) {
|
|
}
|
|
};
|
|
|
|
/**
|
|
* @brief Defines an attribute not set exception. Used to signal the access of undefined references or values.
|
|
* @author Jan Gäbler
|
|
* @ingroup Moversight
|
|
* @class AttributeNotSetException
|
|
*/
|
|
class AttributeNotSetException : public Exception {
|
|
public:
|
|
|
|
/**
|
|
* @brief Constructor
|
|
* @param message What has happened?
|
|
*/
|
|
AttributeNotSetException(const char* message) : Exception(message) {
|
|
}
|
|
};
|
|
|
|
/**
|
|
* @brief Defines a peer not found exception. Used to signal the call for a peer, not stored or found within a list, a cluster et cetera.
|
|
* @author Jan Gäbler
|
|
* @ingroup Moversight
|
|
* @class PeerNotFoundException
|
|
*/
|
|
class PeerNotFoundException : public Exception {
|
|
public:
|
|
|
|
/**
|
|
* @brief Constructor
|
|
* @param message What has happened?
|
|
*/
|
|
PeerNotFoundException(const char* message) : Exception(message) {
|
|
}
|
|
};
|
|
|
|
/**
|
|
* @brief Defines a entry not found exception. Used to signal that a table or map lookup (or similar) has been failed, as the desired element was not found within the storage structure.
|
|
* @author Jan Gäbler
|
|
* @ingroup Moversight
|
|
* @class EntryNotFoundException
|
|
*/
|
|
class EntryNotFoundException : public Exception {
|
|
public:
|
|
|
|
/**
|
|
* @brief Constructor
|
|
* @param message What has happened?
|
|
*/
|
|
EntryNotFoundException(const char* message) : Exception(message) {
|
|
}
|
|
};
|
|
|
|
/**
|
|
* @brief Defines a cluster not found exception. Used to signal the call for a cluster, not stored or found within a list, a group et cetera.
|
|
* @author Jan Gäbler
|
|
* @ingroup Moversight
|
|
* @class ClusterNotFoundException
|
|
*/
|
|
class ClusterNotFoundException : public Exception {
|
|
public:
|
|
|
|
/**
|
|
* @brief Constructor
|
|
* @param message What has happened?
|
|
*/
|
|
ClusterNotFoundException(const char* message) : Exception(message) {
|
|
}
|
|
};
|
|
|
|
/**
|
|
* @brief Defines a peer place exception. Used to signal that an error have occur during placing a peer within the topology.
|
|
* @author Jan Gäbler
|
|
* @ingroup Moversight
|
|
* @class PeerPlaceException
|
|
*/
|
|
class PeerPlaceException : public Exception {
|
|
public:
|
|
|
|
/**
|
|
* @brief Constructor
|
|
* @param message What has happened?
|
|
*/
|
|
PeerPlaceException(const char* message) : Exception(message) {
|
|
}
|
|
};
|
|
|
|
/**
|
|
* @brief Defines cluster limit reached exception. Used to signal that no more clusters can be created within the acutal group setting.
|
|
* @author Jan Gäbler
|
|
* @ingroup Moversight
|
|
* @class ClusterLimitReachedException
|
|
*/
|
|
class ClusterLimitReachedException : public PeerPlaceException {
|
|
public:
|
|
|
|
/**
|
|
* @brief Constructor
|
|
* @param message What has happened?
|
|
*/
|
|
ClusterLimitReachedException(const char* message) : PeerPlaceException(message) {
|
|
}
|
|
};
|
|
|
|
/**
|
|
* @brief Defines a timer not found exception. Used to signal timer errors.
|
|
* @author Jan Gäbler
|
|
* @ingroup Moversight
|
|
* @class TimerNotFoundException
|
|
*/
|
|
class TimerNotFoundException : public Exception {
|
|
public:
|
|
|
|
/**
|
|
* @brief Constructor
|
|
*
|
|
* @param message What has happened?
|
|
*/
|
|
TimerNotFoundException(const char* message) : Exception(message) {
|
|
}
|
|
};
|
|
|
|
/**
|
|
* @brief Defines a invitation not found exception. Used to signal invitation missing errors.
|
|
* @author Jan Gäbler
|
|
* @ingroup Moversight
|
|
* @class InvitationNotFoundException
|
|
*/
|
|
class InvitationNotFoundException : public Exception {
|
|
public:
|
|
|
|
/**
|
|
* @brief Constructor
|
|
*
|
|
* @param message What has happened?
|
|
*/
|
|
InvitationNotFoundException(const char* message) : Exception(message) {
|
|
}
|
|
};
|
|
|
|
/**
|
|
* @brief Defines a parameter exception. Used to signal setup errors.
|
|
* @author Jan Gäbler
|
|
* @ingroup Moversight
|
|
* @class ParameterException
|
|
*/
|
|
class ParameterException : public Exception {
|
|
public:
|
|
|
|
/**
|
|
* @brief Constructor
|
|
*
|
|
* @param message What has happened?
|
|
*/
|
|
ParameterException(const char* message) : Exception(message) {
|
|
}
|
|
};
|
|
|
|
/**
|
|
* @brief Defines an illegal parameter exception. Used to signal that a given parameter is not valid within the current context.
|
|
* @author Jan Gäbler
|
|
* @ingroup Moversight
|
|
* @class IllegalParameterException
|
|
*/
|
|
class IllegalParameterException : public ParameterException {
|
|
public:
|
|
|
|
/**
|
|
* @brief Constructor
|
|
*
|
|
* @param message What has happened?
|
|
*/
|
|
IllegalParameterException(const char * message) : ParameterException(message) {
|
|
}
|
|
};
|
|
|
|
/**
|
|
* @brief Defines a flush in progress exception. Used to signal that a flush is in progress and no other split or merge is allowed.
|
|
* @author Silvio Gaebler
|
|
* @ingroup Moversight
|
|
* @class FlushModeException
|
|
*/
|
|
class FlushModeException : public Exception {
|
|
public:
|
|
|
|
/**
|
|
* @brief Constructor
|
|
*
|
|
* @param message What has happened?
|
|
*/
|
|
FlushModeException(const char * message) : Exception(message) {
|
|
}
|
|
};
|
|
|
|
/**
|
|
* @brief Defines a secondary group exception. Signals that the peer is not allowed to do an action because it's not in the primary group(ongoing partition).
|
|
* @author Grit Schneider
|
|
* @ingroup Moversight
|
|
* @class SecondaryGroupException
|
|
*/
|
|
class SecondaryGroupException : public Exception {
|
|
public:
|
|
/**
|
|
* @brief Constructor
|
|
*
|
|
* @param message What has happened?
|
|
*/
|
|
SecondaryGroupException(const char * message) : Exception(message) {
|
|
}
|
|
};
|
|
|
|
/**
|
|
* @brief Defines a rejoin lock exception. Signals that the peer is not allowed to do an action because it's actually locked due to a ongoing rejoin.
|
|
* @author Grit Schneider
|
|
* @ingroup Moversight
|
|
* @class RejoinLockException
|
|
*/
|
|
class RejoinLockException : public Exception {
|
|
public:
|
|
|
|
/**
|
|
* @brief Constructor
|
|
*
|
|
* @param message What has happened?
|
|
*/
|
|
RejoinLockException(const char * message) : Exception(message) {
|
|
}
|
|
};
|
|
}
|
|
}
|
|
#endif /* UBEEME_EXCEPTION_H */
|
|
|