openni_exception.cpp
Go to the documentation of this file.
1 /*
2  * Software License Agreement (BSD License)
3  *
4  * Copyright (c) 2011 2011 Willow Garage, Inc.
5  * Suat Gedikli <gedikli@willowgarage.com>
6  *
7  * All rights reserved.
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions
11  * are met:
12  *
13  * * Redistributions of source code must retain the above copyright
14  * notice, this list of conditions and the following disclaimer.
15  * * Redistributions in binary form must reproduce the above
16  * copyright notice, this list of conditions and the following
17  * disclaimer in the documentation and/or other materials provided
18  * with the distribution.
19  * * Neither the name of Willow Garage, Inc. nor the names of its
20  * contributors may be used to endorse or promote products derived
21  * from this software without specific prior written permission.
22  *
23  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34  * POSSIBILITY OF SUCH DAMAGE.
35  *
36  */
38 #include <sstream>
39 
40 namespace openni_wrapper
41 {
42 
43 OpenNIException::OpenNIException (const std::string& function_name, const std::string& file_name, unsigned line_number, const std::string& message) throw ()
44 : function_name_ (function_name)
45 , file_name_ (file_name)
46 , line_number_ (line_number)
47 , message_ (message)
48 {
49  std::stringstream sstream;
50  sstream << function_name_ << " @ " << file_name_ << " @ " << line_number_ << " : " << message_;
51  message_long_ = sstream.str();
52 }
53 
55 {
56 }
57 
59 {
60  message_ = exception.message_;
61  return *this;
62 }
63 
64 const char* OpenNIException::what () const throw ()
65 {
66  return message_long_.c_str();
67 }
68 
69 const std::string& OpenNIException::getFunctionName () const throw ()
70 {
71  return function_name_;
72 }
73 
74 const std::string& OpenNIException::getFileName () const throw ()
75 {
76  return file_name_;
77 }
78 
79 unsigned OpenNIException::getLineNumber () const throw ()
80 {
81  return line_number_;
82 }
83 
84 } //namespace openni_camera
const std::string & getFunctionName() const
virtual const char * what() const
General exception class.
OpenNIException & operator=(const OpenNIException &exception)
const std::string & getFileName() const
OpenNIException(const std::string &function_name, const std::string &file_name, unsigned line_number, const std::string &message)


openni_camera
Author(s): Patrick Mihelich, Suat Gedikli, Radu Bogdan Rusu
autogenerated on Wed Jun 5 2019 20:15:22