SAGA C++ API 1.6
job_self.cpp
Go to the documentation of this file.
00001 #if defined(__WAVE__) && defined(SAGA_CREATE_PREPROCESSED_FILES)
00002 #pragma wave option(preserve: 2, line: 1, output: "preprocessed/self.cpp")
00003 #endif
00004 //  Copyright (c) 2005-2009 Hartmut Kaiser
00005 // 
00006 //  Distributed under the Boost Software License, Version 1.0. (See accompanying 
00007 //  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
00008 
00009 #if defined(__WAVE__) && defined(SAGA_CREATE_PREPROCESSED_FILES)
00010 #pragma wave option(output: null)
00011 #endif
00012 
00013 //  this is needed in every file including detail/steerable_impl.hpp and not 
00014 //  belonging to the engine
00015 #define SAGA_NO_EXPORT_STEERABLE
00016 
00017 #include <cstdlib>
00018 
00019 // include job API's and implementation
00020 #include <saga/saga/job.hpp>
00021 #include <saga/saga/adaptors/task.hpp>
00022 #include <saga/saga/adaptors/attribute.hpp>
00023 #include <saga/impl/job.hpp>
00024 
00025 #include <saga/saga/detail/steerable_impl.hpp>
00026 
00027 #ifdef SAGA_DEBUG
00028 #include <saga/saga/packages/self/preprocessed/self.cpp>
00029 #else
00030 
00031 #if defined(__WAVE__) && defined(SAGA_CREATE_PREPROCESSED_FILES)
00032 #pragma wave option(preserve: 2, line: 1, output: "preprocessed/self.cpp")
00033 #endif
00034 
00035 #if !defined(MAX_PATH)
00036 #define MAX_PATH _POSIX_PATH_MAX
00037 #endif
00038 
00040 namespace 
00041 {
00043     // wrapper for gethostname()
00044     inline std::string get_hostname()
00045     {
00046         char buffer[MAX_PATH] = { '\0' };
00047         gethostname(buffer, sizeof(buffer));
00048         return std::string(buffer);
00049     }
00050 
00052 }
00053     
00055 namespace saga 
00056 {
00057    namespace job {
00058     self::self (void) 
00059     {
00060     }
00061     
00062     self::self (saga::impl::job* impl) 
00063     :   job(impl)
00064     {
00065     }
00066     
00067     self::~self (void)
00068     {
00069     }
00070   }
00071 
00072   namespace detail
00073   {
00075     //  implement the attribute functions (we need to explicitly specialize 
00076     //  the template because the functions are not implemented inline)
00077     template struct SAGA_JOB_PACKAGE_EXPORT steerable<job::self>;
00078   }
00079 
00081 } // namespace saga
00082 
00083 #endif
00084 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines