IoTivity C++ SDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
RCSException.h
Go to the documentation of this file.
1 //******************************************************************
2 //
3 // Copyright 2015 Samsung Electronics All Rights Reserved.
4 //
5 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
6 //
7 // Licensed under the Apache License, Version 2.0 (the "License");
8 // you may not use this file except in compliance with the License.
9 // You may obtain a copy of the License at
10 //
11 // http://www.apache.org/licenses/LICENSE-2.0
12 //
13 // Unless required by applicable law or agreed to in writing, software
14 // distributed under the License is distributed on an "AS IS" BASIS,
15 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 // See the License for the specific language governing permissions and
17 // limitations under the License.
18 //
19 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
20 
26 #ifndef RES_ENCAPSULATION_RCSEXCEPTION_H
27 #define RES_ENCAPSULATION_RCSEXCEPTION_H
28 
29 #include <string>
30 
31 #include <octypes.h>
32 
33 #include <boost/config.hpp>
34 
35 namespace OIC
36 {
37  namespace Service
38  {
39 
44  class RCSException: public std::exception
45  {
46  public:
47 
54  RCSException();
55 
63  explicit RCSException(const std::string &what);
64 
72  explicit RCSException(std::string &&what);
73 
74  virtual ~RCSException() BOOST_NOEXCEPT;
75 
80  virtual const char *what() const BOOST_NOEXCEPT;
81 
82  private:
86  const std::string m_what;
87  };
88 
94  {
95  public:
96  explicit RCSPlatformException(OCStackResult reason);
97 
103 
108  std::string getReason() const;
109 
110  private:
111  OCStackResult m_reason;
112  };
113 
119  {
120  public:
121  explicit RCSBadRequestException(const std::string& what);
122  explicit RCSBadRequestException(std::string&& what);
123  };
124 
130  {
131  public:
132  explicit RCSInvalidParameterException(const std::string& what);
133  explicit RCSInvalidParameterException(std::string&& what);
134  };
135 
140  {
141  public:
142  explicit RCSBadGetException(const std::string& what);
143  explicit RCSBadGetException(std::string&& what);
144  };
145 
151  {
152  public:
153  explicit RCSInvalidKeyException(const std::string& what);
154  explicit RCSInvalidKeyException(std::string&& what);
155  };
156 
157  }
158 }
159 
160 #endif // RES_ENCAPSULATION_RCSEXCEPTION_H
OCStackResult getReasonCode() const
Returns the reason.
RCSBadRequestException(const std::string &what)
RCSInvalidParameterException(const std::string &what)
Thrown when a key is invalid.
Definition: RCSException.h:150
Thrown when a parameter is not valid.
Definition: RCSException.h:129
The base exception class for resource encapsulation.
Definition: RCSException.h:44
RCSInvalidKeyException(const std::string &what)
Thrown when getting value with wrong template parameter.
Definition: RCSException.h:139
virtual const char * what() const BOOST_NOEXCEPT
Returns the exception description.
RCSPlatformException(OCStackResult reason)
Thrown when OC layer returns an error.
Definition: RCSException.h:93
RCSException()
Constructs an exception with an empty description.
OCStackResult
Declares Stack Results & Errors.
Definition: octypes.h:1054
This file contains the definition, types and APIs for resource(s) be implemented. ...
virtual ~RCSException() BOOST_NOEXCEPT
Thrown when a request is not acceptable.
Definition: RCSException.h:118
std::string getReason() const
Returns the reason description.
RCSBadGetException(const std::string &what)