7d9b2c06831042ebb15b447f77852e616926bf49
[platform/core/location/maps-plugin-here.git] / inc / engine / routes / RouterError.h
1 /*
2  * Copyright (C) 2013 HERE Global B.V. All rights reserved.
3  * This software, including documentation, is protected by copyright controlled by
4  * HERE Global B.V. (“Software”). All rights are reserved. Copying, including reproducing,
5  * storing, adapting or translating, any or all of this material requires the prior
6  * written consent of HERE Global B.V. You may use this
7  * Software in accordance with the terms and conditions defined in the
8  * HERE Location Platform Services Terms and Conditions, available at
9  * http://developer.here.com/terms-conditions-base
10  *
11  * As an additional permission to the above, you may distribute Software,
12  * in object code format as part of an Application, according to, and subject to, terms and
13  * conditions defined in the Tizen Software Development kit (“SDK”) License Agreement.
14  * You may distribute such object code format Application under terms of your choice,
15  * provided that the header and source files of the Software have not been modified.
16  */
17
18 #ifndef ROUTERERROR_H
19 #define ROUTERERROR_H
20
21 #include "common/HereMaps_global.h"
22 #include "common/ErrorBase.h"
23
24 HERE_MAPS_BEGIN_NAMESPACE
25
26
27 /**
28  * This class encapsulates an error condition that may arise when processing a
29  * routing request.
30  *
31  * \ingroup routes
32  */
33 class EXPORT_API RouterError : public ErrorBase
34 {
35 public:
36
37     /**
38      * This enumeration defines identifiers for the recognized error types.
39      */
40     enum ErrorCode
41     {
42         EC_ParseError,             ///< Indicates a parsing error.
43         EC_UnsupportedOptionError, ///< Indicates that an attempt to use an
44                                    ///  unsupported option was detected. 
45         EC_UnknownError            ///< Indicates an unknown error.
46     };
47
48     /**
49      * This method is a constructor that initializes a new instance of the class
50      * using the error code value supplied by the caller.
51      * 
52      * @param aErrorCode A value indicating the error type to use when
53      *        initializing the new instance of the class.
54      */
55     RouterError(ErrorCode aErrorCode);
56
57     /**
58      * This method is the (virtual) destructor.
59      */
60     virtual ~RouterError();
61
62     /**
63      * This method retrieves the error code.
64      * 
65      * @return A value indicating the error type. 
66      */
67     ErrorCode GetErrorCode() const;
68
69     /**
70      * This method obtains a string representation of the given instance.
71      * The method must be implemented by derived classes.
72      * 
73      * @return A string containing the text representation of the given instance
74      *        of the class.
75      */
76     virtual String ToString() const;
77
78 private:
79     HERE_MAPS_NO_COPY_NO_ASSIGN(RouterError);
80
81     class RouterErrorImpl;
82     RouterErrorImpl* m_pImpl;
83
84 };
85
86 HERE_MAPS_END_NAMESPACE
87
88 #endif