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