1 #include "ace/OS_Memory.h"
2 #include "ace/Log_Msg.h"
4 #include "ace/Containers.h"
5 #include "DataElement.h"
7 int ACE_TMAIN (int, ACE_TCHAR
*[])
9 ACE_Array
<DataElement
*> arr (10);
10 DataElement
*elem
= 0;
11 // Allocate and insert elements.
12 for (int i
= 0; i
< 10; i
++)
14 ACE_NEW_RETURN (elem
, DataElement (i
), -1);
19 ACE_ASSERT (arr
.set (elem
, 11) == -1);
20 ACE_ASSERT (arr
.get (elem
, 11) == -1);
22 // Make a copy and compare to the original.
23 ACE_Array
<DataElement
*> copy
= arr
;
24 ACE_ASSERT (copy
== arr
);
26 ACE_Array
<DataElement
*>::ITERATOR
iter (arr
);
32 ACE_TEXT ("%d\n"), (*data
)->getData ()));