CORBA::Object_ptr TAO::Object_Group_Creator::create_infrastructure_managed_group ( const char * type_id) { CORBA::Object_var group = CORBA::Object::_nil (); if (this->have_replication_manager_) { // set typeid properties PortableGroup::Properties properties (1); properties.length (3); properties[0].nam.length (1); properties[0].nam[0].id = PortableGroup::PG_MEMBERSHIP_STYLE; properties[0].val <<= PortableGroup::MEMB_INF_CTRL; PortableGroup::InitialNumberMembersValue inm(2); properties[1].nam.length (1); properties[1].nam[0].id = PortableGroup::PG_INITIAL_NUMBER_MEMBERS; properties[1].val <<= inm; PortableGroup::MinimumNumberMembersValue mnm(1); properties[2].nam.length (1); properties[2].nam[0].id = PortableGroup::PG_MINIMUM_NUMBER_MEMBERS; properties[2].val <<= mnm; this->replication_manager_->set_type_properties ( type_id, properties); ::PortableGroup::GenericFactory::FactoryCreationId_var creation_id; PortableGroup::Criteria criteria (1); criteria.length (1); criteria[0].nam.length (1); criteria[0].nam[0].id = PortableGroup::PG_MEMBERSHIP_STYLE; criteria[0].val <<= PortableGroup::MEMB_APP_CTRL; group = this->replication_manager_->create_object ( type_id, criteria, creation_id ); } else { ACE_ERROR ((LM_ERROR, ACE_TEXT("%T %n (%P|%t): Object_Group_Creator: infrastructure managed group requires Replication Manager\n") )); } return group._retn (); }
int min( int a,int b, int c ){ return mnm(mnm(a,b), c); }