1 #include "Coordinator.h"
3 Coordinator::Coordinator (CORBA::ULong peer_count
)
6 , peer_max_ (peer_count
)
8 ACE_NEW (this->peers_
, Test::Peer_var
[this->peer_max_
]);
11 Coordinator::~Coordinator (void)
13 delete[] this->peers_
;
17 Coordinator::has_all_peers (void) const
19 return this->peer_count_
== this->peer_max_
;
23 Coordinator::create_session_list (Test::Session_Control_ptr session_control
,
24 CORBA::ULong payload_size
,
25 CORBA::ULong thread_count
,
26 CORBA::ULong message_count
,
27 Test::Session_List
&session_list
)
29 session_list
.length (this->peer_count_
);
30 CORBA::ULong count
= 0;
31 for (Test::Peer_var
*i
= this->peers_
;
32 i
!= this->peers_
+ this->peer_count_
;
35 session_list
[count
++] =
36 (*i
)->create_session (session_control
,
45 Coordinator::shutdown_all_peers (void)
47 for (Test::Peer_var
*i
= this->peers_
;
48 i
!= this->peers_
+ this->peer_count_
;
54 (*i
) = Test::Peer::_nil ();
56 catch (const CORBA::Exception
& ex
)
58 ex
._tao_print_exception ("Coordinator::shutdown, ignored");
64 Coordinator::add_peer (Test::Peer_ptr peer
)
66 if (this->peer_count_
>= this->peer_max_
)
69 this->peers_
[this->peer_count_
++] =
70 Test::Peer::_duplicate (peer
);