runtime_loader.h

00001 /*
00002     Copyright 2005-2011 Intel Corporation.  All Rights Reserved.
00003 
00004     The source code contained or described herein and all documents related
00005     to the source code ("Material") are owned by Intel Corporation or its
00006     suppliers or licensors.  Title to the Material remains with Intel
00007     Corporation or its suppliers and licensors.  The Material is protected
00008     by worldwide copyright laws and treaty provisions.  No part of the
00009     Material may be used, copied, reproduced, modified, published, uploaded,
00010     posted, transmitted, distributed, or disclosed in any way without
00011     Intel's prior express written permission.
00012 
00013     No license under any patent, copyright, trade secret or other
00014     intellectual property right is granted to or conferred upon you by
00015     disclosure or delivery of the Materials, either expressly, by
00016     implication, inducement, estoppel or otherwise.  Any license under such
00017     intellectual property rights must be express and approved by Intel in
00018     writing.
00019 */
00020 
00021 #ifndef __TBB_runtime_loader_H
00022 #define __TBB_runtime_loader_H
00023 
00024 #if ! TBB_PREVIEW_RUNTIME_LOADER
00025     #error Set TBB_PREVIEW_RUNTIME_LOADER to include runtime_loader.h
00026 #endif
00027 
00028 #include "tbb/tbb_stddef.h"
00029 #include <climits>
00030 
00031 #if _MSC_VER
00032     #if ! __TBB_NO_IMPLICIT_LINKAGE
00033         #ifdef _DEBUG
00034             #pragma comment( linker, "/nodefaultlib:tbb_debug.lib" )
00035             #pragma comment( linker, "/defaultlib:tbbproxy_debug.lib" )
00036         #else
00037             #pragma comment( linker, "/nodefaultlib:tbb.lib" )
00038             #pragma comment( linker, "/defaultlib:tbbproxy.lib" )
00039         #endif
00040     #endif
00041 #endif
00042 
00043 namespace tbb {
00044 
00045 namespace interface6 {
00046 
00048 
00085 class runtime_loader : tbb::internal::no_copy {
00086 
00087     public:
00088 
00090         enum error_mode {
00091             em_status,     
00092             em_throw,      
00093             em_abort       
00094         }; // error_mode
00095 
00097         enum error_code {
00098             ec_ok,         
00099             ec_bad_call,   
00100             ec_bad_arg,    
00101             ec_bad_lib,    
00102             ec_bad_ver,    
00103             ec_no_lib      
00104         }; // error_code
00105 
00107         runtime_loader( error_mode mode = em_abort );
00108 
00110 
00115         runtime_loader(
00116             char const * path[],                           
00117             int          min_ver = TBB_INTERFACE_VERSION,  
00118             int          max_ver = INT_MAX,                
00119             error_mode   mode    = em_abort                
00120         );
00121 
00123         ~runtime_loader();
00124 
00126 
00150         error_code
00151         load(
00152             char const * path[],                           
00153             int          min_ver = TBB_INTERFACE_VERSION,  
00154             int          max_ver = INT_MAX                 
00155 
00156         );
00157 
00158 
00160 
00163         error_code status();
00164 
00165     private:
00166 
00167         error_mode const my_mode;
00168         error_code       my_status;
00169         bool             my_loaded;
00170 
00171 }; // class runtime_loader
00172 
00173 } // namespace interface6
00174 
00175 using interface6::runtime_loader;
00176 
00177 } // namespace tbb
00178 
00179 #endif /* __TBB_runtime_loader_H */
00180 

Copyright © 2005-2011 Intel Corporation. All Rights Reserved.

Intel, Pentium, Intel Xeon, Itanium, Intel XScale and VTune are registered trademarks or trademarks of Intel Corporation or its subsidiaries in the United States and other countries.

* Other names and brands may be claimed as the property of others.