~ubuntu-branches/ubuntu/hardy/swig1.3/hardy

« back to all changes in this revision

Viewing changes to Examples/php4/reference/example.cxx

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-12-05 01:16:04 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051205011604-ygx904it6413k3go
Tags: 1.3.27-1ubuntu1
Resynchronise with Debian again, for the new subversion packages.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
VectorArray::VectorArray(int size) {
22
22
  items = new Vector[size];
23
23
  maxsize = size;
24
 
printf("Vectorarray new: self=%p\n",this);
 
24
  printf("VectorArray new: self=%p\n",this);
25
25
}
26
26
 
27
27
VectorArray::~VectorArray() {
 
28
  printf("VectorArray delete: self=%p\n",this);
28
29
  delete [] items;
29
30
}
30
31
 
31
32
Vector &VectorArray::operator[](int index) {
32
 
printf("Vectorarray: read[%d] self=%p\n",index,this);
 
33
  printf("VectorArray: read[%d] self=%p\n",index,this);
33
34
  if ((index < 0) || (index >= maxsize)) {
34
35
    printf("Panic! Array index out of bounds.\n");
35
36
    exit(1);
38
39
}
39
40
 
40
41
int VectorArray::size() {
41
 
printf("Vectorarray: size %d self=%p\n",maxsize,this);
 
42
  printf("VectorArray: size %d self=%p\n",maxsize,this);
42
43
  return maxsize;
43
44
}
44
45