NCL Composer  0.1.5
 All Classes Functions Variables Pages
ParentNotFound.h
1 /* Copyright (c) 2011 Telemidia/PUC-Rio.
2  * All rights reserved. This program and the accompanying materials
3  * are made available under the terms of the Eclipse Public License v1.0
4  * which accompanies this distribution, and is available at
5  * http://www.eclipse.org/legal/epl-v10.html
6  *
7  * Contributors:
8  * Telemidia/PUC-Rio - initial API and implementation
9  */
10 #ifndef PARENTNOTFOUND_H
11 #define PARENTNOTFOUND_H
12 
13 #include <QString>
14 
15 #include <exception>
16 using namespace std;
17 
18 namespace composer{
19  namespace core {
20  namespace util {
21 
26 class ParentNotFound : public exception
27 {
28  private:
29  QString element;
30  QString parent;
31  QString id;
32  public:
40  ParentNotFound(QString _element, QString _parent ,QString _id) :
41  element(_element), parent(_parent), id(_id) {}
42 
46  ~ParentNotFound() throw() {}
47 
51  const char* what() const throw() {
52  QString ret = "Entity (" + parent + ") parent of "
53  + element + "(" + id + ") could not be found!";
54  return ret.toStdString().c_str();
55  }
56 };
57 }}}
58 #endif // PARENTNOTFOUND_H