123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320 |
- #ifndef LAYOUTEXCEPTION_H
- #define LAYOUTEXCEPTION_H
- #include <GraphLayoutLibrary_global.h>
- #include <LayoutException/LayoutExceptionEnum.h>
- #include <QString>
- #include <QObject>
- #include <stdexcept>
- #include <boost/exception/exception.hpp>
- /**
- * @brief The LayoutException class
- *
- * The class defines layout related exceptions. Inherited fron standard exceptions and Boost exceptions.
- */
- class GRAPHLAYOUTLIBRARYSHARED_EXPORT LayoutException : std::exception, boost::exception
- {
- private:
- LayoutExceptionEnum :: LayoutExceptionTypes m_enExceptionType; /*!< Exception Type */
- QString m_sErrorMessage; /*!< Error Message */
- QString m_sExceptionFunctionName; /*!< Function where exception occured */
- LayoutExceptionEnum :: LayoutExceptionSubTypes m_enExceptionSubType;
- /** stores the id(VertexDescriptor, EdgeDescriptor, SubGraph) for the entity */
- QString m_sEntityId;
- QString m_sEntityType;
- QString m_sEntityValue;
- /** stores the attribute name and value */
- QString m_sAttributeName;
- QString m_sAttributeValue;
- // Private Helper Functions
- /** @name Helper
- * The methods under this section are helper functions of LayoutException.
- */
- /**
- Constructs the error message string for the specified exception sub type.
- @pre none
- @param none
- @return string containing error message specific to the exception subtype.
- @throw none
- */
- QString constructMessageForExceptionSubType();
- protected:
- //Modifiers
- /** @name Modifiers
- * The methods under this section are responsible for modifying
- * an instance of type LayoutException.
- */
- //@{
- /**
- Sets Current exception in member variable
- @pre none
- @param LayoutExceptionEnum
- layout exception enum
- @return none
- @throw none
- */
- void setExceptionType(LayoutExceptionEnum::LayoutExceptionTypes enExceptionType);
- /**
- Sets Current error message in member variable
- @pre none
- @param sErrorMessage
- Error message
- @return none
- @throw none
- */
- void setErrorMessage(QString sErrorMessage);
- //@}
- public:
- //Creator
- /** @name Creators
- * The methods under this section are responsible for constructing or
- * destructing an instance of type LayoutException.
- */
- //@{
- /**
- Constructs new object of type LayoutException.
- @pre none
- @param none
- @return none
- @throw none
- */
- LayoutException();
- /**
- Constructs new object of type LayoutException.
- @pre none
- @param sFunctionName
- Name of function which threw exception
-
- @param enExceptionType
- Type of exception. Enum of type LayoutExceptionTypes. default : LAYOUTEXCEPTION
-
- @return none
- @throw none
- */
- LayoutException(QString sFunctionName, LayoutExceptionEnum::LayoutExceptionTypes enExceptionType = LayoutExceptionEnum::LAYOUTEXCEPTION);
- /**
- Constructs new object of type LayoutException.
- @pre none
- @param sFunctionName
- Name of function which threw exception
-
- @param enLayoutExceptionSubType
- Subtype of exception. Enum of type LayoutExceptionSubTypes.
- @return none
- @throw none
- */
- LayoutException(QString sFunctionName, LayoutExceptionEnum::LayoutExceptionSubTypes enLayoutExceptionSubType);
- /**
- Constructs new object of type LayoutException.
- @pre none
- @param sFunctionName
- Name of function which threw exception
-
- @param enLayoutExceptionSubType
- Subtype of exception. Enum of type LayoutExceptionSubTypes.
-
- @param sEntityValue
- String
-
- @param sEntityType
- String
- @return none
- @throw none
- */
- LayoutException(QString sFunctionName,
- LayoutExceptionEnum::LayoutExceptionSubTypes enLayoutExceptionSubType,
- QString sEntityValue,
- QString sEntityType = "");
- /**
- Constructs new object of type LayoutException.
- @pre none
- @param sFunctionName
- Name of function which threw exception
-
- @param enLayoutExceptionSubType
- Subtype of exception. Enum of type LayoutExceptionSubTypes.
-
- @param sEntityValue
- String
-
- @param sEntityType
- String
-
- @param sAttributeName
- String
-
- @param sAttributeValue
- String
- @return none
- @throw none
- */
- LayoutException(QString sFunctionName,
- LayoutExceptionEnum::LayoutExceptionSubTypes enLayoutExceptionSubType,
- QString sEntityValue,
- QString sEntityType,
- QString sAttributeName,
- QString sAttributeValue);
-
- /**
- Destroys object of type LayoutException.
-
- @throw exception
- */
- ~LayoutException() throw();
- //@}
- //Queries
- /** @name Queries
- * The methods under this section are responsible for querying
- * an instance of type LayoutException.
- */
- //@{
- /**
- This function returns the type of the exception.
- @pre none
- @param none
- @return the type of the exception.
- @throw none
- */
- virtual unsigned int getExceptionType();
- /**
- This function returns the error message associated with the exception.
- @pre none
- @param none
- @return the error message associated with the exception.
- @throw none
- */
- QString getErrorMessage();
- /**
- This function returns the name of the function which has thrown the exception.
- @pre none
- @param none
- @return the name of the function which has thrown the exception.
- @throw none
- */
- QString getExceptionFunctionName();
- /**
- This function returns the error code associated with the exception.
- @pre none
- @param none
- @return the error code associated with the exception.
- @throw none
- */
- virtual int getErrorCode();
- /**
- This function returns the string containing entity value
- @pre none
- @param none
- @return the string containing entity value associated with the exception.
- @throw none
- */
- QString getEntityValue();
- /**
- This function returns the string containing type of the entity associated with the exception.
- @pre none
- @param none
- @return the string containing entity value associated with the exception.
- @throw none
- */
- QString getEntityType();
- /**
- This function returns enum Layout Exception SubType associated with the exception.
- @pre none
- @param none
- @return enum Layout Exception SubType associated with the exception.
- @throw none
- */
- LayoutExceptionEnum::LayoutExceptionSubTypes getExceptionSubType();
- //@}
- //Modifiers
- /** @name Modifiers
- * The methods under this section are responsible for modifying
- * an instance of type LayoutException.
- */
- //@{
- void setExceptionFunctionName(QString sFunctionName);
- //@}
- };
- #endif // LAYOUTEXCEPTION_H
|