[omniORB] How avoid copying "in" parameters?

DA SILVA Antonio adasilva at carax.com
Thu Feb 7 13:38:42 GMT 2008


Hi all,

When I declare a parameter as "in" inside an IDL,
it is then implemented as a reference in C++.
How can I store the parameter/data I receive in this
reference without copying it?

For example :

struct Message
{
    attribute string to_do;
};

interface Worker
{
    boolean addWork( in Message msg );
};

==> implemented as :

class WorkerImpl : public Worker
{
    //..................
    // I would like to store the msg in a message queue
    // without copying it because it can generate performance
    // issues.
    CORBA::Boolean addWork( const Message& msg )
  {
       m_queue.store( msg ); // Store a copy of msg...
  }
};

Any ideas?

Antonio.




More information about the omniORB-list mailing list