2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 * @file job_exception_base.h
18 * @author Pawel Sikorski (p.sikorski@samgsung.com)
23 #include <dpl/exception.h>
25 #ifndef SRC_INSTALLER_CORE_JOBS_JOB_EXCEPTION_BASE_H_
26 #define SRC_INSTALLER_CORE_JOBS_JOB_EXCEPTION_BASE_H_
28 #define DECLARE_JOB_EXCEPTION_BASE(Base, Class, Param) \
32 Class(const char *path, \
33 const char *function, \
35 const std::string & message = std::string()) : \
36 Base(path, function, line, message) \
38 m_className = #Class; \
42 Class(const char *path, \
43 const char *function, \
45 const Exception &reason, \
46 const std::string & message = std::string()) : \
47 Base(path, function, line, reason, message) \
49 m_className = #Class; \
53 virtual int getParam() const \
60 //TODO template for m_param
62 #define DECLARE_JOB_EXCEPTION(Base, Class, Param) \
66 Class(const char *path, \
67 const char *function, \
69 const std::string & message = std::string()) : \
70 Base(path, function, line, message) \
72 m_className = #Class; \
76 Class(const char *path, \
77 const char *function, \
79 const Exception &reason, \
80 const std::string & message = std::string()) : \
81 Base(path, function, line, reason, message) \
83 m_className = #Class; \
87 virtual int getParam() const \
92 //TODO template for m_param
94 //TODO maybe use DPL:: DECLARE_EXCEPTION_TYPE instead of creating own
97 DECLARE_JOB_EXCEPTION_BASE(DPL::Exception, JobExceptionBase, 0)
100 #endif /* SRC_INSTALLER_CORE_JOBS_JOB_EXCEPTION_BASE_H_ */