Exemplo n.º 1
0
pbbool
be_ServerTieHeader::Open(const DDS_StdString& mainFilename)
{
   if (be_Source::Open(mainFilename))
   {
      os << "//******************************************************************\n"
      << "// \n"
      << "//  Generated by IDL to C++ Translator\n"
      << "//  \n"
      << "//  File name: " << filename << "\n"
      << "//  Source: " << idl_global->main_filename()->get_string() << "\n"
      << "//  Generated: " << CreationTime() << "\n"
      << "//  OpenFusion V" << VERSION << "\n"
      << "//  \n"
      << "//******************************************************************\n";

      ndefname = Ifndefize(filename);

      os << "#ifndef " << (const char*)ndefname << nl;
      os << "#define " << (const char*)ndefname << nl << nl;
      os << nl;

      return pbtrue;
   }
}
Exemplo n.º 2
0
pbbool be_ClientHeader::Open (const DDS_StdString& mainFilename)
{
   if (be_Source::Open (mainFilename))
   {
      BE_Globals::HFileOpen = pbtrue;
      os << "//******************************************************************\n"
         << "// \n"
         << "//  Generated by IDL to C++ Translator\n"
         << "//  \n"
         << "//  File name: " << BE_Globals::ClientHeaderFilename << "\n"
         << "//  Source: " << idl_global->main_filename()->get_string() << "\n"
         << "//  Generated: " << CreationTime() << "\n"
         << "//  OpenSplice " << OSPL_VERSION_STR << "\n"
         << "//  \n"
         << "//******************************************************************\n";

      ndefname = Ifndefize(BE_Globals::ClientHeaderFilename);
      os << "#ifndef " << (const char*) ndefname << nl;
      os << "#define " << (const char*) ndefname << nl;
      if (BE_Globals::isocpp || BE_Globals::isocpp_new_types)
      {
        os << "#ifndef OPENSPLICE_ISOCXX_PSM" << nl;
        os << "#define OPENSPLICE_ISOCXX_PSM" << nl;
        os << "#endif" << nl;
      }
      os << nl << "#include \"sacpp_mapping.h\"" << nl;
//      os << "#include \"sacpp_DDS_DCPS.h\"" << nl;
      GenerateSecondaryIncludes (os);
      if (BE_Globals::isocpp_new_types)
      {
        os << "#include <dds/core/ddscore.hpp>" << nl;
      }
      if (BE_Globals::isocpp_test_methods)
      {
        os << "#include <generate_test_values.hpp>" << nl;
      }
      if (BE_Globals::UserDLL != (const char *)"" &&
          BE_Globals::UserDLLHeader != (const char *)"" )
      {
        os << "#include \"" << BE_Globals::UserDLLHeader << "\"" << nl;
      }

      if (BE_Globals::UserDLL != (const char *)"")
      {
         BE_Globals::DLLExtension = " ";
      }
      os << nl;
      return pbtrue;
   }
   else
   {
      return pbfalse;
   }
}
Exemplo n.º 3
0
pbbool be_ClientHeader::Open (const DDS_StdString& mainFilename)
{
   if (be_Source::Open (mainFilename))
   {
      BE_Globals::HFileOpen = pbtrue;
      os << "//******************************************************************\n"
         << "// \n"
         << "//  Generated by IDL to C++ Translator\n"
         << "//  \n"
         << "//  File name: " << BE_Globals::ClientHeaderFilename << "\n"
         << "//  Source: " << idl_global->main_filename()->get_string() << "\n"
         << "//  Generated: " << CreationTime() << "\n"
         << "//  OpenSplice " << VERSION << "\n"
         << "//  \n"
         << "//******************************************************************\n";

      ndefname = Ifndefize(BE_Globals::ClientHeaderFilename);
      os << "#ifndef " << (const char*) ndefname << nl;
      os << "#define " << (const char*) ndefname << nl << nl;
      if (BE_Globals::UserDLL != (const char *)"" &&
          BE_Globals::UserDLLHeader != (const char *)"" )
      {
        os << "#include \"" << BE_Globals::UserDLLHeader << "\"" << nl;
      }
      os << "#include \"sacpp_mapping.h\"" << nl;
      os << "#include \"sacpp_DDS_DCPS.h\"" << nl;

      GenerateSecondaryIncludes (os);

      if (BE_Globals::UserDLL != (const char *)"")
      {
         BE_Globals::DLLExtension = " ";
      }

      return pbtrue;
   }
   else
   {
      return pbfalse;
   }
}
Exemplo n.º 4
0
pbbool be_ServerHeader::Open(const DDS_StdString& mainFilename)
{
   if (be_Source::Open(mainFilename))
   {
      if (!BE_Globals::gen_onefile)
      {

         os << "//******************************************************************\n"
         << "// \n"
         << "//  Generated by IDL to C++ Translator\n"
         << "//  \n"
         << "//  File name: " << BE_Globals::ServerHeaderFilename << "\n"
         << "//  Source: " << idl_global->main_filename()->get_string() << "\n"
         << "//  Generated: " << CreationTime() << "\n"
         << "//  OpenFusion V" << VERSION << "\n"
         << "//  \n"
         << "//******************************************************************\n";
      }

      if (BE_Globals::gen_onefile)
      {
         ndefname = Ifndefize(BE_Globals::ServerHeaderFilename);
      }
      else
      {
         ndefname = Ifndefize(BE_Globals::ServerHeaderFilename);
      }

      os << "#ifndef " << (const char*)ndefname << nl;
      os << "#define " << (const char*)ndefname << nl << nl;
      os << nl;

      os << "#include \"eOrb/idl_s.h\"" << nl;

      if (DDSRealIncludeFiles::includes[FindFilename(BE_Globals::ClientHeaderFilename)].length() == 0)
      {
         if (!BE_Globals::gen_onefile)
         {
            os << "#include \"" << (const char*)BE_Globals::ClientHeaderFilename << "\"" << nl;
         }
      }
      else
      {
         if (!BE_Globals::gen_onefile)
         {
            os << "#include \"" << (const char*)DDSRealIncludeFiles::includes[FindFilename(BE_Globals::ClientHeaderFilename)] << "\"" << nl;
         }
      }

      String_map::iterator it;

      for (it = idlIncludes.begin() ; it != idlIncludes.end(); it++)
      {
                 DDS_StdString file(it.value() + BE_Globals::ServerExtension + "." + BE_Globals::hExtension);

         if (DDSRealIncludeFiles::includes[file].length() == 0)
         {
            os << "#include \"" << (const char*)file << "\"" << nl;
         }
         else
         {
            os << "#include \"" << (const char*)DDSRealIncludeFiles::includes[file] << "\"" << nl;
         }
      }

      os << nl;

      return pbtrue;
   }
   else
   {
      return pbfalse;
   }
}
Exemplo n.º 5
0
void be_root::Generate (be_ClientHeader & source)
{
   be_CppFwdDecl::GenerateAllWithinScope (source, be_CppEnclosingScope());

   ostream& os = source.Stream ();
   TList<be_Type *>::iterator bit;
   TList<be_exception *>::iterator git;

   for (bit = fwdDecls.begin(); bit != fwdDecls.end(); bit++)
   {
      (*bit)->GenerateFwdDecls(source);
   }

   os << nl;
   GenerateGlobalTypes (source);
   GenerateGlobalDecls (source);

   g_generatorList.GenerateGlobal (source);

   if (BE_Globals::gen_externalization)
   {
      os << nl;

      for (bit = streamOps.begin(); bit != streamOps.end(); bit++)
      {
         (*bit)->GenerateStreamOps(source);
      }
   }

   os << nl;

   for (git = globalDecls.begin(); git != globalDecls.end(); git++)
   {
      (*git)->GenerateGlobalDecls (source);
   }

   os << nl;

   for (bit = typedefs.begin(); bit != typedefs.end(); bit++)
   {
      (*bit)->GenerateGlobalTypedef (source);
   }

   os << nl;

   if(BE_Globals::isocpp_test_methods)
   {
      //Generate file to stop missing file error
      DDS_StdString BaseFilename;
      BaseFilename = StripExtension(source.Filename());
      BaseFilename += "_testmethod.h";
      be_Source testsource;
      if(!testsource.Open(BaseFilename))
        cerr << "Cannot open: " << BaseFilename << endl;
      testsource.Close();

      //os << nl << "#ifndef " << Ifndefize(BE_Globals::ClientHeaderFilename + "DCPS");
      os << nl << "#ifndef " << Ifndefize(StripExtension(FindFilename(source.Filename())) + "DCPS.h");
      os << nl << "#ifndef " << Ifndefize(StripExtension(FindFilename(source.Filename())) + "_testmethod.h");
      os << nl << "#define " << Ifndefize(StripExtension(FindFilename(source.Filename())) + "_testmethod.h");
      os << nl << "#include \"" << StripExtension(FindFilename(source.Filename())) + "_testmethod.h" << "\"";
      os << nl << "#endif " << nl << "#endif" << nl;

   }

   if (BE_Globals::lite)
   {
       DDS_StdString BaseFilename;
       BaseFilename = StripExtension(source.Filename());

       os << "\n#include \"" << BaseFilename << "-lite.h" << "\"" << nl;
   }

   os << nl << "#endif" << nl;
   source.Close();
}