Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Serializing TAO/CORBA objects with boost::serialization

I have a problem with serializing classes generated by corba - especially with any kind of sequences - TAO::unbouded_value_sequence, TAO::unbouded_basic_string_sequence, etc.

Is there any "good" solution for serialization of CORBA structures or do I have reverse engineer the code of corba clases and try to write serialization funtion for each of them?

EDIT:

      struct Something;

      typedef
        TAO_Var_Var_T<
            Something
          >
        Something_var;

      typedef
        TAO_Out_T<
            Something
          >
        Something_out;


      struct  Something
      {
        typedef Something_var _var_type;
        typedef Something_out _out_type;

        static void _tao_any_destructor (void *);
        TAO::String_Manager member1;
      };
    class SequenceOfSomething;

  typedef
    TAO_VarSeq_Var_T<
        SequenceOfSomething
      >
    SequenceOfSomething_var;

  typedef
    TAO_Seq_Out_T<
        SequenceOfSomething
      >
    SequenceOfSomething_out;

  class  SequenceOfSomething
    : public
        TAO::unbounded_value_sequence<
            Something
          >
  {
  public:
    SequenceOfSomething (void);
    SequenceOfSomething ( ::CORBA::ULong max);
    SequenceOfSomething (
        ::CORBA::ULong max,
        ::CORBA::ULong length,
        SequenceOfSomething* buffer, 
        ::CORBA::Boolean release = false
      );
    SequenceOfSomething (const SequenceOfSomething &);
    virtual ~SequenceOfSomething (void);

    static void _tao_any_destructor (void *);

    typedef SequenceOfSomething_var _var_type;
    typedef SequenceOfSomething_out _out_type;


  };

This is some sample code generated from IDL definitions.

like image 249
Siekacz Avatar asked Aug 18 '26 12:08

Siekacz


1 Answers

I installed the ACE+TAO frameworks, and fiddled with things.¹

It looks like it's easier to go from the actual IDL.

The code to parse the IDL is included in the SDK, so maybe you can leverage that to generate some serialization code.

Sidenote: why Boost Serialize something that has IIOP serialization fully implemented for it? Could you consider Boost Serializing a binary buffer with the ACE serialization? If not, why not?


¹ actually compiling code: http://paste.ubuntu.com/12907686/

like image 58
sehe Avatar answered Aug 20 '26 03:08

sehe