be_init.cpp

Go to the documentation of this file.
00001 /*
00002  *
00003  *
00004  * Distributed under the OpenDDS License.
00005  * See: http://www.opendds.org/license.html
00006  */
00007 
00008 #include "../Version.h"
00009 
00010 #include "tao/Version.h"
00011 #include "global_extern.h"
00012 #include "be_extern.h"
00013 #include "drv_extern.h"
00014 
00015 #include "ace/OS_NS_stdlib.h"
00016 
00017 #include <iostream>
00018 #include <iomanip>
00019 
00020 void
00021 BE_version()
00022 {
00023   ACE_DEBUG((LM_DEBUG, ACE_TEXT("OpenDDS version ") ACE_TEXT(DDS_VERSION)
00024              ACE_TEXT("\n")));
00025 }
00026 
00027 int
00028 BE_init(int&, ACE_TCHAR*[])
00029 {
00030   ACE_NEW_RETURN(be_global, BE_GlobalData, -1);
00031   return 0;
00032 }
00033 
00034 void
00035 BE_post_init(char*[], long)
00036 {
00037   std::ostringstream version;
00038   version << "-D__OPENDDS_IDL=0x"
00039           << std::setw(2) << std::setfill('0') << DDS_MAJOR_VERSION
00040           << std::setw(2) << std::setfill('0') << DDS_MINOR_VERSION
00041           << std::setw(2) << std::setfill('0') << DDS_MICRO_VERSION;
00042   DRV_cpp_putarg(version.str().c_str());
00043 
00044 #ifdef ACE_HAS_CDR_FIXED
00045   DRV_cpp_putarg("-D__OPENDDS_IDL_HAS_FIXED");
00046 #endif
00047 
00048   const char* env = ACE_OS::getenv("DDS_ROOT");
00049   if (env && env[0]) {
00050     std::string dds_root = env;
00051     if (dds_root.find(' ') != std::string::npos && dds_root[0] != '"') {
00052       dds_root.insert(dds_root.begin(), '"');
00053       dds_root.insert(dds_root.end(), '"');
00054     }
00055     be_global->add_inc_path(dds_root.c_str());
00056     ACE_CString included;
00057     DRV_add_include_path(included, dds_root.c_str(), 0, true);
00058   }
00059 }

Generated on Fri Feb 12 20:05:19 2016 for OpenDDS by  doxygen 1.4.7