OpenDDS  Snapshot(2023/04/28-20:55)
Functions
be_init.cpp File Reference
#include "be_extern.h"
#include "be_util.h"
#include "../Version.h"
#include <global_extern.h>
#include <drv_extern.h>
#include <ace/OS_NS_stdlib.h>
#include <iostream>
#include <iomanip>
Include dependency graph for be_init.cpp:

Go to the source code of this file.

Functions

void BE_version ()
 
int BE_init (int &, ACE_TCHAR *[])
 
void BE_post_init (char *[], long)
 

Function Documentation

◆ BE_init()

int BE_init ( int &  ,
ACE_TCHAR [] 
)

Definition at line 28 of file be_init.cpp.

References ACE_NEW_RETURN, and be_global.

29 {
31  idl_global->default_idl_version_ = IDL_VERSION_4;
32  idl_global->anon_type_diagnostic(IDL_GlobalData::ANON_TYPE_SILENT);
33  return 0;
34 }
BE_GlobalData * be_global
Definition: be_global.cpp:44
#define ACE_NEW_RETURN(POINTER, CONSTRUCTOR, RET_VAL)

◆ BE_post_init()

void BE_post_init ( char *  [],
long   
)

Definition at line 37 of file be_init.cpp.

References be_global, ACE_String_Base< char >::c_str(), be_util::dds_root(), OPENDDS_MAJOR_VERSION, OPENDDS_MICRO_VERSION, OPENDDS_MINOR_VERSION, and Annotations::register_all().

38 {
39  if (idl_global->idl_version_ < IDL_VERSION_4) {
40  idl_global->ignore_files_ = true; // Exit without parsing files
41  be_global->error("OpenDDS requires IDL version to be 4 or greater");
42  return;
43  }
44 
45  std::ostringstream version;
46  version << "-D__OPENDDS_IDL=0x"
47  << std::setw(2) << std::setfill('0') << OPENDDS_MAJOR_VERSION
48  << std::setw(2) << std::setfill('0') << OPENDDS_MINOR_VERSION
49  << std::setw(2) << std::setfill('0') << OPENDDS_MICRO_VERSION;
50  DRV_cpp_putarg(version.str().c_str());
51 
52 #ifdef ACE_HAS_CDR_FIXED
53  DRV_cpp_putarg("-D__OPENDDS_IDL_HAS_FIXED");
54 #endif
55 
56  std::string include_dds = be_util::dds_root();
57  if (include_dds.find(' ') != std::string::npos && include_dds[0] != '"') {
58  include_dds.insert(include_dds.begin(), '"');
59  include_dds.insert(include_dds.end(), '"');
60  }
61  be_global->add_inc_path(include_dds.c_str());
62  ACE_CString included;
63  DRV_add_include_path(included, include_dds.c_str(), 0, true);
64 
65  DRV_cpp_putarg("-D__OPENDDS_IDL_HAS_ANNOTATIONS");
66  be_global->builtin_annotations_.register_all();
67  // This annotation isn't used, but must match the one in idl2jni to avoid
68  // warnings or errors.
69  idl_global->eval("module OpenDDS {@annotation hidden_op_in_java {string impl;};};\n");
70 }
#define OPENDDS_MICRO_VERSION
Definition: Version.h:13
const char * c_str(void) const
void register_all()
Definition: annotations.cpp:14
#define OPENDDS_MINOR_VERSION
Definition: Version.h:12
const char * dds_root()
Get DDS_ROOT. It is a fatal error if it wasn&#39;t set.
#define OPENDDS_MAJOR_VERSION
Definition: Version.h:11
BE_GlobalData * be_global
Definition: be_global.cpp:44

◆ BE_version()

void BE_version ( void  )

Definition at line 21 of file be_init.cpp.

References ACE_DEBUG, ACE_TEXT(), LM_DEBUG, and OPENDDS_VERSION.

22 {
23  ACE_DEBUG((LM_DEBUG, ACE_TEXT("OpenDDS version ") ACE_TEXT(OPENDDS_VERSION)
24  ACE_TEXT("\n")));
25 }
#define ACE_DEBUG(X)
#define OPENDDS_VERSION
Definition: Version.h:16
ACE_TEXT("TCP_Factory")