[omniORB] idl mapping to structs

Leandro Fanzone leandro@hasar.com
Thu, 19 Jul 2001 12:57:18 -0300


Well, that changes the problem. Then I would suggest making the operator==
outside the structure, with no need for deriving. In the previous example I
gave you, that would be

bool
operator==(const StructTest::SomeStruct &Left, const StructTest::SomeStruct
&Right)
{
    return Left.l == Right.l;
}

Leandro Fanzone

Frederico Faria wrote:

> Hi Leandro,
>
> I think that my problem is with the use of  std::find() algorithms  over
> my list.
>
> Thank you,
>
> Leandro Fanzone wrote:
> >
> > I don't see any reason to implement an operator= just to use std::list,
> > if I understood your problem. The following code compiles OK for omniORB
> > 3.0.4, gcc 3.0:
> >
> > IDL:
> >
> > interface StructTest
> > {
> >     struct SomeStruct
> >     {
> >         unsigned long l;
> >     };
> > };
> >
> > C++:
> >
> > list<StructTest::SomeStruct> l;
> >
> > for (unsigned i = 0; i < 10; i++)
> > {
> >     StructTest::SomeStruct p;
> >     p.l = i;
> >     l.push_back(p);
> > }
> >
> > for (list<StructTest::SomeStruct>::iterator i = l.begin(); i != l.end();
> > i++)
> >     cout << i->l << endl;
> >
> > Leandro Fanzone
> > Compañía HASAR
> > Buenos Aires
> > Argentina
> >
> > Frederico Faria wrote:
> >
> > > Hi,
> > >
> > > In my implementation code I inherit my idl struct type to
> > > add an operator== method. In this way , I will can use the
> > > stl list<> implementation with  the derived struct.
> > >
> > > Is There any other method to resolve it ?
> > >
> > > thank you,
> > >
> > > Faria