コード例 #1
0
ファイル: objRsrc.cpp プロジェクト: Kurusamy/tnvme
SharedTrackablePtr
ObjRsrc::GetObj(string lookupName)
{
    TrackableMap::iterator item;

    item = mObjGrpLife.find(lookupName);
    if (item == mObjGrpLife.end()) {
        LOG_DBG("Object lookup name %s was not found", lookupName.c_str());
        return SharedTrackablePtr();  // (SharedTrackablePtr->expired() == true)
    }
    return (*item).second;
}
コード例 #2
0
ファイル: objRsrc.cpp プロジェクト: cldong/tnvme
SharedTrackablePtr
ObjRsrc::AllocWorker(Trackable::ObjType type)
{
    switch (type) {
    case Trackable::OBJ_MEMBUFFER:
        LOG_NRM("MemBuffer is born with group lifetime");
        return SharedTrackablePtr(new MemBuffer());
        break;
    case Trackable::OBJ_ACQ:
        LOG_NRM("ACQ is born with group lifetime");
        return SharedTrackablePtr(new ACQ(mFd));
        break;
    case Trackable::OBJ_ASQ:
        LOG_NRM("ASQ is born with group lifetime");
        return SharedTrackablePtr(new ASQ(mFd));
        break;
    case Trackable::OBJ_IOCQ:
        LOG_NRM("IOCQ is born with group lifetime");
        return SharedTrackablePtr(new IOCQ(mFd));
        break;
    case Trackable::OBJ_IOSQ:
        LOG_NRM("IOSQ is born with group lifetime");
        return SharedTrackablePtr(new IOSQ(mFd));
        break;
    case Trackable::OBJ_IDENTIFY:
        LOG_NRM("Cmd Identify is born with group lifetime");
        return SharedTrackablePtr(new Identify(mFd));
        break;
    case Trackable::OBJ_CREATEIOCQ:
        LOG_NRM("Cmd Create IOCQ is born with group lifetime");
        return SharedTrackablePtr(new CreateIOCQ(mFd));
        break;
    case Trackable::OBJ_CREATEIOSQ:
        LOG_NRM("Cmd Create IOSQ is born with group lifetime");
        return SharedTrackablePtr(new CreateIOSQ(mFd));
        break;
    case Trackable::OBJ_DELETEIOCQ:
        LOG_NRM("Cmd Delete IOCQ is born with group lifetime");
        return SharedTrackablePtr(new DeleteIOCQ(mFd));
        break;
    case Trackable::OBJ_DELETEIOSQ:
        LOG_NRM("Cmd Delete IOSQ is born with group lifetime");
        return SharedTrackablePtr(new DeleteIOSQ(mFd));
        break;
    case Trackable::OBJ_GETFEATURES:
        LOG_NRM("Cmd Get Features is born with group lifetime");
        return SharedTrackablePtr(new GetFeatures(mFd));
        break;
    case Trackable::OBJ_SETFEATURES:
        LOG_NRM("Cmd Set Features is born with group lifetime");
        return SharedTrackablePtr(new SetFeatures(mFd));
        break;
    default:
        LOG_DBG("Unknown obj type specified: 0x%02X", type);
        break;
    }

    return Trackable::NullTrackablePtr;
}