Change naming convention for C++ interfaces
[alexxy/gromacs.git] / src / gromacs / gmxlib / oenv.cpp
index ebe3d156da1961303144cfc9460121b2a3cef3d4..e835286bf7430e0d2d6c84baa83245158ffbdf30 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#include "oenv.h"
+#include "gmxpre.h"
 
-#include "gromacs/utility/smalloc.h"
+#include "gromacs/legacyheaders/oenv.h"
 
-#include "gromacs/utility/programcontext.h"
 #include "gromacs/utility/exceptions.h"
+#include "gromacs/utility/programcontext.h"
+#include "gromacs/utility/smalloc.h"
 
 struct output_env
 {
-    explicit output_env(const gmx::ProgramContextInterface &context)
+    explicit output_env(const gmx::IProgramContext &context)
         : programContext(context)
     {
         time_unit   = time_ps;
         view        = FALSE;
         xvg_format  = exvgNONE;
         verbosity   = 0;
-        debug_level = 0;
     }
 
-    const gmx::ProgramContextInterface  &programContext;
+    const gmx::IProgramContext  &programContext;
 
     /* the time unit, enum defined in oenv.h */
     time_unit_t                          time_unit;
@@ -63,8 +63,6 @@ struct output_env
     xvg_format_t                         xvg_format;
     /* The level of verbosity for this program */
     int                                  verbosity;
-    /* the debug level */
-    int                                  debug_level;
 };
 
 /* The source code in this file should be thread-safe.
@@ -93,9 +91,9 @@ static const char *time_units_xvgr[] = {
 /***** OUTPUT_ENV MEMBER FUNCTIONS ******/
 
 void output_env_init(output_env_t *oenvp,
-                     const gmx::ProgramContextInterface &context,
+                     const gmx::IProgramContext &context,
                      time_unit_t tmu, gmx_bool view, xvg_format_t xvg_format,
-                     int verbosity, int debug_level)
+                     int verbosity)
 {
     try
     {
@@ -105,7 +103,6 @@ void output_env_init(output_env_t *oenvp,
         oenv->view        = view;
         oenv->xvg_format  = xvg_format;
         oenv->verbosity   = verbosity;
-        oenv->debug_level = debug_level;
     }
     GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
 }
@@ -131,11 +128,6 @@ int output_env_get_verbosity(const output_env_t oenv)
     return oenv->verbosity;
 }
 
-int output_env_get_debug_level(const output_env_t oenv)
-{
-    return oenv->debug_level;
-}
-
 const char *output_env_get_time_unit(const output_env_t oenv)
 {
     return time_units_str[oenv->time_unit];
@@ -202,30 +194,21 @@ xvg_format_t output_env_get_xvg_format(const output_env_t oenv)
     return oenv->xvg_format;
 }
 
-const char *output_env_get_program_name(const output_env_t oenv)
+const char *output_env_get_program_display_name(const output_env_t oenv)
 {
-    try
-    {
-        return oenv->programContext.fullBinaryPath();
-    }
-    GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
-}
+    const char *displayName = NULL;
 
-const char *output_env_get_short_program_name(const output_env_t oenv)
-{
     try
     {
-        // TODO: Use the display name once it doesn't break anything.
-        return oenv->programContext.programName();
+        displayName = oenv->programContext.displayName();
     }
     GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
+
+    return displayName;
 }
 
-const char *output_env_get_cmd_line(const output_env_t oenv)
+const gmx::IProgramContext &
+output_env_get_program_context(const output_env_t oenv)
 {
-    try
-    {
-        return oenv->programContext.commandLine();
-    }
-    GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
+    return oenv->programContext;
 }