1 #include "ace/Get_Opt.h"
2 #include "ace/Argv_Type_Converter.h"
3 #include "ace/SString.h"
4 #include "ace/Manual_Event.h"
6 #include "tao/Transport_Cache_Manager_T.h"
13 static int global_purged_count
= 0;
15 typedef TAO::Transport_Cache_Manager_T
<mock_transport
, mock_tdi
, mock_ps
> TCM
;
18 #include "mock_transport.h"
22 ACE_TMAIN(int argc
, ACE_TCHAR
*argv
[])
28 // We need an ORB to get an ORB core
29 CORBA::ORB_var orb
= CORBA::ORB_init (argc
, argv
);
31 // We create 10 transports and have a max of 5 tran
33 size_t const transport_max
= 10;
34 size_t const cache_maximum
= 5;
35 int purging_percentage
= 20;
37 mock_transport mytransport
[transport_max
];
38 mock_tdi mytdi
[transport_max
];
39 mock_ps
* myps
= new mock_ps(10);
40 TCM
my_cache (purging_percentage
, myps
, cache_maximum
, false, 0);
42 // Cache all transports in the cache
43 for (i
= 0; i
< transport_max
; i
++)
45 my_cache
.cache_transport (&mytdi
[i
], &mytransport
[i
]);
46 mytransport
[i
].purging_order (i
);
49 if (my_cache
.current_size () != cache_maximum
)
51 ACE_ERROR ((LM_ERROR
, "ERROR Incorrect cache size %d\n", my_cache
.current_size ()));
58 catch (const CORBA::Exception
&)
60 // Ignore exceptions..