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 ()
13 delete[] this->peers_
;
17 Coordinator::has_all_peers () 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 ()
47 for (Test::Peer_var
*i
= this->peers_
;
48 i
!= this->peers_
+ this->peer_count_
;
55 catch (const CORBA::Exception
& ex
)
57 ex
._tao_print_exception ("Coordinator::shutdown, ignored");
63 Coordinator::add_peer (Test::Peer_ptr peer
)
65 if (this->peer_count_
>= this->peer_max_
)
68 this->peers_
[this->peer_count_
++] =
69 Test::Peer::_duplicate (peer
);