[gephex-devel] gephex--main--0.4--patch-1847

gephex at sonnenland.kexbox.org gephex at sonnenland.kexbox.org
Sat Feb 26 02:53:19 CET 2005


Archive: gephex at gephex.org--2004
New revision: gephex--main--0.4--patch-1847

--
Revision: gephex--main--0.4--patch-1847
Archive: gephex at gephex.org--2004
Creator: The Gephex Source Archive <gephex at gephex.org>
Date: Sat Feb 26 02:50:38 CET 2005
Standard-date: 2005-02-26 01:50:38 GMT
Modified-files: engine/src/engine/controller.cpp
    engine/src/engine/controller.h
    engine/src/engine/main.cpp
New-patches: gephex at gephex.org--2004/gephex--main--0.4--patch-1847
    martin at gephex.org--2004/gephex--martin--0.4--patch-59
Summary: [MERGE-REQUEST] ttl parameter for the engine
Keywords: 

Patches applied:

 * martin at gephex.org--2004/gephex--martin--0.4--patch-59
   time to live parameter for the engine

* added files

    {arch}/gephex/gephex--main/gephex--main--0.4/gephex at gephex.org--2004/patch-log/patch-1847
    {arch}/gephex/gephex--martin/gephex--martin--0.4/martin at gephex.org--2004/patch-log/patch-59

* modified files

--- orig/engine/src/engine/controller.cpp
+++ mod/engine/src/engine/controller.cpp
@@ -241,7 +241,9 @@
       pModel(config.get_string_param("graph_path"), logger),
       pRenderer(logger),
       pDllLoader(logger),
-      first_time(true)
+      first_time(true),
+      ttl(config.get_int_param("ttl")),
+      time(0)
   {
     
     net::IServerSocket* serverSocket;
@@ -384,7 +386,7 @@
     std::cout.flush();
     pModel.updateFileSystem();
     std::cout << "   done
";
-	
+
     try 
       {
         pModel.newGraphWithID("default", "_default_", false);
@@ -461,15 +463,16 @@
 	  {
 	    logger->error("Engine Exception Handler", e.what());
 	  }
-	/*	catch(...)
-                {
-                logger->error("Oh oh....", "Oh oh oh...");
-                }*/
       }
   }
   
   bool Controller::run()
-  { 
+  {
+    ++time;
+
+    if ( ttl != 0  &&  time == ttl )
+      shutDown();
+    
     try 
       {
         // here comes what happens after the connection to the gui is


--- orig/engine/src/engine/controller.h
+++ mod/engine/src/engine/controller.h
@@ -182,6 +182,8 @@
       engine::Scheduler scheduler;
 
       bool first_time;
+      unsigned int time;
+      unsigned int ttl;
     };
 
 }


--- orig/engine/src/engine/main.cpp
+++ mod/engine/src/engine/main.cpp
@@ -249,19 +249,21 @@
                                       "in the filesystem (unix only)", &def));
 
 
-      def.b = false;
+      def.b = true;
       params.push_back(config_param_t("headless",
                                       config_param_t::BOOL_PARAM,
                                       "engine",
                                       "Start without GUI, load all "
                                       "available modules", &def));
 
+      def.b = true;
       params.push_back(config_param_t("autostart",
                                       config_param_t::BOOL_PARAM,
                                       "engine",
                                       "Automatically start the "
                                       "rendering", &def));
 
+
       def.s = "_default_";
       params.push_back(config_param_t("render_graph_id",
                                       config_param_t::STRING_PARAM,
@@ -275,6 +277,13 @@
                                       "The snapshot that is initially "
                                       "active", &def));
 
+      def.i = 0; // no timeout
+      params.push_back(config_param_t("ttl",
+                                      config_param_t::INT_PARAM,
+                                      "engine",
+                                      "Timeout"
+                                      , &def));
+
       utils::ConfigManager config(get_cfile_name(), argc, argv, params);
 
       // This is a hack to communicate the media path to



More information about the gephex-devel mailing list