[cpp] Structs with atomic types and objects



Murray asked me to summarize today's achievements with ORBit/C++.

Yesterday I got object marshalling working. Today I fixed structures. To
do this, I created the _forwarder classes as mentioned in my previous
mail (I'll need to include a CORBA::Object_forwarder for barebones
CORBA::Objects to work in structs, I'll postpone it for tomorrow)

So anyway, after the last strokes, the whole picture came together:
stuctures containing atomic types (like Long) and/or objects are
marshalled properly in both directions. Or at least, so it seems (we need
test cases! we _BADLY_ need good test cases!)


Here's the IDL I used to test it:

module hellomodule {

    interface OutputStream {
        void print (in string message);
    };

    struct OutputArg {
        OutputStream stream;
        long         number;
    };
    
    interface Hello {
        void hello (in OutputArg in_struct, in string greeting);
    };
    
};

Both the 'stream' and the 'number' member of the in_struct argument of
hello has been marshalled properly: calling a method on in_struct.stream 
in Hello::hello's implementation works as expected, and so does printing
out in_struct.number:

void Hello_impl::hello (const OutputArg &in_struct,
			const char      *message) throw (CORBA::SystemException)
{
    std::cout << "Hello_Impl: Greeting is \"" << message << "\"" << std::endl;

    std::cout << "Number is " << in_struct.number << std::endl;
    in_struct.stream->print (message);
}


-- 
   .--= ULLA! =---------------------.   `We are not here to give users what
   \     http://cactus.rulez.org     \   they want'  -- RMS, at GUADEC 2001
    `---= cactus@cactus.rulez.org =---'
Hogy érted hogy leformattáltad a macskát?




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]