Exploring the Big Data Structure with safearray

Source: Internet
Author: User

During development, we often encounter the need to transmit structures or multiple variables. To adapt to the transmission of Multiple Data Structure Variables, Microsoft defined the safearray variable. For this reason, I have studied this variable, share with netizens.

 

Essentially, safearray adds a descriptor to a common array, indicating its dimension, length, boundary, element type, and other information.

I. Definition

Typedef struct tagsafearraybound
{
Ulong celements;
Long llbound;
} Safearraybound;

 

Typedef struct tagsafearray
{
Ushort cdims;
Ushort ffeatures;
Ulong cbelements;
Ulong clocks;
Pvoid pvdata;
Safearraybound rgsabound [1];
} Safearray;

 

Ii. operation API

/*---------------------------------------------------------------------*/
/* Safearray API */
/*---------------------------------------------------------------------*/

Winoleautapi safearrayallocdescriptor (uint cdims, safearray ** ppsaout );
Winoleautapi safearrayallocdescriptorex (vartype VT, uint cdims, safearray ** ppsaout );
Winoleautapi safearrayallocdata (safearray * PSA );
Winoleautapi _ (safearray *) safearraycreate (vartype VT, uint cdims, safearraybound * rgsabound );
Winoleautapi _ (safearray *) safearraycreateex (vartype VT, uint cdims, safearraybound * rgsabound, pvoid pvextra );
Winoleautapi safearraycopydata (safearray * psasource, safearray * psatarget );
Winoleautapi safearraydestroydescriptor (safearray * PSA );
Winoleautapi safearraydestroydata (safearray * PSA );
Winoleautapi safearraydestroy (safearray * PSA );
Winoleautapi safearrayredim (safearray * PSA, safearraybound * psaboundnew );
Winoleautapi _ (uint) safearraygetdim (safearray * PSA );
Winoleautapi _ (uint) safearraygetelemsize (safearray * PSA );
Winoleautapi safearraygetubound (safearray * PSA, uint Ndim, long * plubound );
Winoleautapi safearraygetlbound (safearray * PSA, uint Ndim, long * pllbound );
Winoleautapi safearraylock (safearray * PSA );
Winoleautapi safearrayunlock (safearray * PSA );
Winoleautapi safearrayaccessdata (safearray * PSA, void hugep ** ppvdata );
Winoleautapi safearrayunaccessdata (safearray * PSA );
Winoleautapi safearraygetelement (safearray * PSA, long * rgindices, void * PV );
Winoleautapi safearrayputelement (safearray * PSA, long * rgindices, void * PV );
Winoleautapi safearraycopy (safearray * PSA, safearray ** ppsaout );
Winoleautapi safearrayptrofindex (safearray * PSA, long * rgindices, void ** ppvdata );
Winoleautapi safearraysetrecordinfo (safearray * PSA, irecordinfo * prinfo );
Winoleautapi safearraygetrecordinfo (safearray * PSA, irecordinfo ** prinfo );
Winoleautapi safearraysetiid (safearray * PSA, refguid guid );
Winoleautapi safearraygetiid (safearray * PSA, guid * pguid );
Winoleautapi safearraygetvartype (safearray * PSA, vartype * PVT );
Winoleautapi _ (safearray *) safearraycreatevector (vartype VT, long llbound, ulong celements );

 

Iii. Use

 

4. nagging, since csdn was unable to be opened during the Olympics that few days ago, it was originally written for a long time and has never been made public, and has not been updated during this period, later, I wrote it slowly.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.