Ejemplo n.º 1
0
void NamingContextHelper::appendBindingList(CosNaming::BindingList_var& bList, ObjectInfoList& objects)
{
    for (CORBA::ULong i = 0; i < bList->length(); ++i) {
        ObjectInfo info;
        info.id_ = bList[i].binding_name[0].id;
        info.kind_ = bList[i].binding_name[0].kind;
        info.isContext_ = false;
        info.hostAddress_ = host_;
        info.portNo_ = port_;

        CORBA::Object_ptr obj = findObject(info.id_, info.kind_);
        info.isAlive_ = isObjectAlive(obj);
        
        if(info.isAlive_){
            CosNaming::NamingContext_var check = CosNaming::NamingContext::_narrow(obj);
            if(check != CosNaming::NamingContext::_nil()){
                info.isContext_ = true;
            }
        }

        info.ior_ = orb->object_to_string(obj);
        ObjectPath path(info.id_, info.kind_);
        info.fullPath_.push_back(path);
        CORBA::release(obj);
        objects.push_back(info);
    }
}
Ejemplo n.º 2
0
void NamingContextHelper::appendBindingList(CosNaming::BindingList_var& bList, ObjectInfoList& objects)
{
    for(CORBA::ULong i=0; i < bList->length(); ++i){
        ObjectInfo info;
        info.id = bList[i].binding_name[0].id;
        info.kind = bList[i].binding_name[0].kind;
        CORBA::Object_ptr obj = findObject(info.id);
        info.isAlive = isObjectAlive(obj);
        CORBA::release(obj);
        objects.push_back(info);
    }
}
Ejemplo n.º 3
0
void NamingContextHelper::appendBindingList(CosNaming::BindingList_var& bList, std::vector<ObjectPath> pathList, ObjectInfoList& objects)
{
    for (CORBA::ULong i = 0; i < bList->length(); ++i) {
        ObjectInfo info;
        info.id_ = bList[i].binding_name[0].id;
        info.kind_ = bList[i].binding_name[0].kind;
        info.hostAddress_ = host_;
        info.portNo_ = port_;

        ObjectPath path(info.id_, info.kind_);
        pathList.push_back(path);

        CORBA::Object_ptr obj = findObjectSub(pathList);
        info.isAlive_ = isObjectAlive(obj);
        info.ior_ = orb->object_to_string(obj);
        copy(pathList.begin(), pathList.end(), std::back_inserter(info.fullPath_));
        pathList.pop_back();
        CORBA::release(obj);
        objects.push_back(info);
    }
}