vtkVoidArray

功能:

It provides methodsfor insertion and retrieval of these pointers values, and will automatically resize itself to hold new data.

变量:
  void** Array;   // pointer to data
  int Size;       // allocated size of data
  int MaxId;     // maximum index inserted thus far
  int Extend;     // grow array by this point

函数:

//new分配出sz大小的空间,Extend=ext,MaxId=-1,size=sz;

int Allocate(const int sz, const int ext=1000);

//delete释放空间,size=0,MaxId=-1

void Initialize();

//MaxId=-1,其他不变

void Reset();

//Size=sz,数据可能被截取或补空

void** Resize(const int sz);

//size=MaxId+1;

void Squeeze();

//返回(Array+id)

void** GetPtr(const int id);

//返回(Array+id)的同时,要保证其后有number个空间分配,通过(Resize,MaxId=size+number)扩展
void** WritePtr(const int id, const int number);

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值