[omniORB] Missing constructor for fixed-length structured types

Daniel Krügler daniel.kruegler at gmail.com
Wed Apr 29 14:46:48 BST 2015


According to the Corba C++ mapping generation (Version 1.2),
fixed-length structured types shall also provide a _var_type and the
specification says in §4.11.1:

<quote>
For reasons of consistency, the T_var types are also produced for
fixed-length structured types. These types have the same semantics as
T_var types for variable-length types. This allows applications to be
coded in terms of T_var types regardless of whether the underlying
types are fixed- or variable-length. T_var types for fixed-length
structured types have the following general form:

// C++
class T_var {
public:
  T_var() : m_ptr(0) {}
  T_var(T *t) : m_ptr(t) {}
  T_var(const T& t) : m_ptr(new T(t)) {}
  [..]
};
</quote>

But it seems that the OmniOrb's 4.2.0 mapping class generation is not
conforming, because it misses to create the constructor

T_var(const T& t);

in the corresponding template _CORBA_ConstrType_Fix_Var.

We stumbled across this problem recently, because in our model-driven
architecture we use generated code to wrap our CORBA layer to
encapsulate the remote protocol used underneath (CORBA, in this case)
and therefore our code generation attempts to initialize the a
_var_type object with the return type of a service function. This
works in all cases except for fixed-length structured types. This is
very unfortunate, because it means the actually conforming generated
code is ill-formed and we have to generate a different code path for
this case.

I would like to suggest to provide the missing constructor in
_CORBA_ConstrType_Fix_Var. It seems the missing code is just as simple
as adding:

inline _CORBA_ConstrType_Fix_Var(T p) { pd_data = p; }

Thanks,

Daniel Krügler



More information about the omniORB-list mailing list