[prev in list] [next in list] [prev in thread] [next in thread]
List: berlin-cvs
Subject: [Fresco-changes] Fresco/Fresco-C++-demos/src Application.hh,1.24,1.25 demo.cc,1.27,1.28 demo3D.cc,1.
From: Tobias Hunger <tobias () fresco ! org>
Date: 2003-11-03 22:59:10
[Download RAW message or body]
Update of /cvs/fresco/Fresco/Fresco-C++-demos/src
In directory purcel:/tmp/cvs-serv11590/Fresco-C++-demos/src
Modified Files:
Application.hh demo.cc demo3D.cc
Log Message:
Move create_demo templates into Application.hh so it can be shared by both
demos and make it report the error message attached to an exception in
case of failure.
Index: Application.hh
===================================================================
RCS file: /cvs/fresco/Fresco/Fresco-C++-demos/src/Application.hh,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- Application.hh 18 Feb 2003 21:18:14 -0000 1.24
+++ Application.hh 3 Nov 2003 22:59:07 -0000 1.25
@@ -106,4 +106,25 @@
Fresco::Graphic_var _print;
};
+template <typename T> T *create_demo(Application *a)
+{
+ try { return new T(a);}
+ catch (std::exception &e)
+ {
+ std::cerr << "Unable to create one of the demo applets:" << std::endl
+ << "The error message I received awas: \""
+ << e.what() << "\"" << std::endl
+ << "This probably means that the server doesn't provide" << std::endl
+ << "some of the resources requested by this applet" << std::endl;
+ return 0;
+ }
+ catch (...)
+ {
+ std::cerr << "Unable to create one of the demo applets." << std::endl
+ << "This probably means that the server doesn't provide" << std::endl
+ << "some of the resources requested by this applet" << std::endl;
+ return 0;
+ }
+}
+
#endif
Index: demo.cc
===================================================================
RCS file: /cvs/fresco/Fresco/Fresco-C++-demos/src/demo.cc,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- demo.cc 27 Oct 2003 17:08:40 -0000 1.27
+++ demo.cc 3 Nov 2003 22:59:07 -0000 1.28
@@ -39,18 +39,6 @@
using namespace Prague;
using namespace Fresco;
-template <typename T> T *create_demo(Application *a)
-{
- try { return new T(a);}
- catch (...)
- {
- std::cerr << "unable to create one of the demo applets\n"
- << "this probably means that the server doesn't provide\n"
- << "some of the resources requested by this applet" << std::endl;
- return 0;
- }
-}
-
int main(int argc, char **argv)
{
Prague::GetOpt getopt(argv[0], "C++ fresco demo");
Index: demo3D.cc
===================================================================
RCS file: /cvs/fresco/Fresco/Fresco-C++-demos/src/demo3D.cc,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- demo3D.cc 6 Nov 2002 05:44:14 -0000 1.10
+++ demo3D.cc 3 Nov 2003 22:59:07 -0000 1.11
@@ -30,18 +30,6 @@
using namespace Prague;
using namespace Fresco;
-template <typename T> T *create_demo(Application *a)
-{
- try { return new T(a);}
- catch (...)
- {
- std::cerr << "unable to create one of the demo applets\n"
- << "this probably means that the server doesn't provide\n"
- << "some of the resources requested by this applet" << std::endl;
- return 0;
- }
-}
-
int main(int argc, char **argv)
{
Prague::GetOpt getopt(argv[0], "C++ fresco demo (3D)");
_______________________________________________
Fresco-changes mailing list
Fresco-changes@fresco.org
http://lists.fresco.org/cgi-bin/listinfo/fresco-changes
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic