NCL Composer  0.1.5
 All Classes Functions Variables Pages
CreationFailed.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 CREATIONFAILED_H
11 #define CREATIONFAILED_H
12 
13 #include <QString>
14 
15 #include <exception>
16 using namespace std;
17 
18 namespace composer{
19  namespace core {
20  namespace util {
21 
25 class CreationFailed : public exception
26 {
27  private:
28  QString element;
29  QString id;
30  public:
37  CreationFailed(QString _element, QString _id) :
38  element(_element), id(_id) {}
39  ~CreationFailed() throw() {}
40  const char* what() const throw() {
41  QString ret = "Entity (" + element + ") with id (" + id + ") could "
42  + "not be created!";
43  return ret.toStdString().c_str();
44  }
45 };
46 }}}
47 
48 #endif // CREATIONFAILED_H