Question on efficiency of using sequences with legacy applications

Question on efficiency of using sequences with legacy applications

Post by Shamim Ahme » Wed, 23 Apr 1997 04:00:00



I have a situation where I need to exchange large buffers (eg.
array of floats) between a CORBA client app and a legacy application
wrapped as a CORBA server. I have the following type of interface
for passing a buffer of floats from client to server:

typedef sequence<float> FloatArray; // for example
interface X
{
   void SendData(in FloatArray MyData);

Quote:}

At the server side, I'd like to just grab the float buffer (that is
contained in the generated sequence class) and pass it to the legacy
app, which in this case just dumps it to some kind of persistent
storage (in other words, there is an implicit copy).
But given the sequence interface, I cannot do this, and
need to create a seperate buffer on the server side and fill it
up with elements from the sequence by iterating over it (pseudocode
with Orbix2.1):

void
X::SendData(
        const FloatArray& MyData)
{
   // would really like to grab MyData._buffer, but it is private

   int Length = MyData.length;
   // allocate a new buffer for legacy app
   float* ServerData = (float*)calloc(Length*sizeof(float));
   for (int i = 0; i < Length; i++)
   {
       // fill up ServerData by interating over MyData
       // etc.
   }
   // pass ServerData to legacy routine
   // etc.

Quote:}

Needless to say, this is not very efficient. Is there a faster,
more efficient way to accomplish what I want w/o all this
copying of buffers (other than hacking the generated code to make
FloatArray::_buffer public)?

(As an aside, how is this handled in DCOM?)

Thanks fo any insights
--Shamim
******************************************************

Group Leader,                  
Software Systems               (512)-331-3132
SCHLUMBERGER AUSTIN RESEARCH   (512)-331-3760 (Fax)
8311 FM 620 Rd,
Austin, TX 78726                
http://www.austin.asc.slb.com/~ahmed/shamim.html          
******************************************************

 
 
 

Question on efficiency of using sequences with legacy applications

Post by Thomas A. Ru » Wed, 23 Apr 1997 04:00:00



 >
 > I have a situation where I need to exchange large buffers (eg.
 > array of floats) between a CORBA client app and a legacy application
 > wrapped as a CORBA server. I have the following type of interface
 > for passing a buffer of floats from client to server:
 >
 >
 > typedef sequence<float> FloatArray; // for example
 > interface X
 > {
 >    void SendData(in FloatArray MyData);
 > }

Why not just use an array of floats?  I assume you have a fixed size for
this legacy array.

typedef float FloatArray[1000];  // for a 1000 element array

 interface X
 {
 void SendData (in FloatArray MyData);
 }

--


 
 
 

Question on efficiency of using sequences with legacy applications

Post by Aninda Sengupt » Wed, 23 Apr 1997 04:00:00



> At the server side, I'd like to just grab the float buffer (that is
> contained in the generated sequence class) and pass it to the legacy
> app, which in this case just dumps it to some kind of persistent
> storage (in other words, there is an implicit copy).
> But given the sequence interface, I cannot do this, and
> need to create a seperate buffer on the server side and fill it
> up with elements from the sequence by iterating over it (pseudocode
> with Orbix2.1):

> Needless to say, this is not very efficient. Is there a faster,
> more efficient way to accomplish what I want w/o all this
> copying of buffers (other than hacking the generated code to make
> FloatArray::_buffer public)?

It is really funny because Orbix seems to oscillate on the mapping for
buffer attribute in sequences. In the old days of Orbix 1.3 C++ mapping
the _buffer used to be public it got protected in Orbix 2.0 and to cap
it all the OrbixWeb mappings in java has it public again.

In the current scenario, the hack to access the private _buffer variable
is :

&(MyData[0])

This works because the _buffer is a contiguous array & the current
sequence::operator[] (i) is implemented as
        return _buffer[i];

And do not blame me for the hack - the original suggestion was in a

- aninda

 
 
 

1. Using NET-SNMP to enable a legacy application running on Linux 7.

It is my task to bolt an agent onto an existing application within a
Linux 7 environment.  The point is to create a subagent enabled
application.  I am not particularly familiar with the NET-SNMP open
source tool, though it is my intent to use this technology.  I have
noted the NET-SNMP seems to use agentX type techniques, similar to the
techniques used by the Microsoft agent available for WindowsNT/2000,
and so registration is a familiar process, etc.

Perhaps some readers here are more familiar with NET-SNMP, and can
thus provide a little guidance on the process of SNMP enablement for
user application software.  The product being augmented makes heavy
use of socket programming (another area in which I have little
exposure), and it seems to me that this should make adding the agent a
bit easier (than would be the case for an application which had no
prior interface with an IP stack).

William R. Buckley

2. FS: Tektronix Netstations

3. Driving a 'legacy' GUI application using Java (& testing tool ?)

4. fpkg on HP-UX 11

5. Using MRTG with Baystack 28115 as well as efficiency question.....

6. GRAPHIKCARD

7. Legacy C structs and sequences

8. Help w/selecting a computer 4 internet server

9. What are legacy classes, wat zijn legacy classes?

10. Newbie Question: How to do Sequence of Sequence in C++

11. MIB question: sequence in sequence not allowed?

12. Compiler Efficiencies Regarding Embedded Applications

13. On Legacy Applications and Previous Work