当前位置: 首页>>代码示例>>C++>>正文


C++ ObjectId类代码示例

本文整理汇总了C++中ObjectId的典型用法代码示例。如果您正苦于以下问题:C++ ObjectId类的具体用法?C++ ObjectId怎么用?C++ ObjectId使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了ObjectId类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: from_path

DirectoryEntryPtr
MetaDataStore::rename(const ObjectId& from_parent,
                      const std::string& from,
                      const ObjectId& to_parent,
                      const std::string& to)
{
    LOG_TRACE(from << " -> " << to);

    FrontendPath from_path(find_path(from_parent));
    from_path /= from;

    FrontendPath to_path(find_path(to_parent));
    to_path /= to;

    boost::optional<DirectoryEntryPtr>
        maybe_overwritten(harakoon_.rename<DirectoryEntry>(yt::UUID(from_parent.str()),
                                                           from,
                                                           yt::UUID(to_parent.str()),
                                                           to));
    drop_from_cache(from_path);

    DirectoryEntryPtr dentry;

    if (maybe_overwritten)
    {
        drop_from_cache(to_path);
        dentry = *maybe_overwritten;
    }

    return dentry;
}
开发者ID:DarumasLegs,项目名称:volumedriver,代码行数:31,代码来源:MetaDataStore.cpp

示例2: MOZ_ASSERT

ObjectId
WrapperOwner::idOfUnchecked(JSObject *obj)
{
    MOZ_ASSERT(IsCPOW(obj));

    Value v = GetProxyExtra(obj, 1);
    MOZ_ASSERT(v.isDouble());

    ObjectId objId = ObjectId::deserialize(BitwiseCast<uint64_t>(v.toDouble()));
    MOZ_ASSERT(!objId.isNull());

    return objId;
}
开发者ID:Andrel322,项目名称:gecko-dev,代码行数:13,代码来源:WrapperOwner.cpp

示例3: contextMenu

void QtIVIWidget::contextMenu(QPoint pos)
{
    QModelIndex index = m_objectTreeView->indexAt(pos);
    if (!index.isValid())
        return;
    index = index.sibling(index.row(), 0);
    const ObjectId objectId = index.data(ObjectModel::ObjectIdRole).value<ObjectId>();
    if (objectId.isNull())
        return;

    QMenu menu;
    ContextMenuExtension ext(objectId);
    ext.populateMenu(&menu);
    menu.exec(m_objectTreeView->viewport()->mapToGlobal(pos));
}
开发者ID:KDAB,项目名称:GammaRay,代码行数:15,代码来源:qtivisupportwidget.cpp

示例4: FileExistsException

void
MetaDataStore::add(const ObjectId& parent,
                   const std::string& name,
                   DirectoryEntryPtr dentry)
{
    LOG_TRACE(parent << ", dentry uuid " << dentry->object_id() << " name " << name);

    const yt::UUID p(parent.str());
    const boost::optional<DirectoryEntry> oldval;

    try
    {
        harakoon_.test_and_set(p,
                               name,
                               *dentry,
                               oldval);
    }
    catch (HierarchicalArakoon::PreconditionFailedException)
    {
        throw FileExistsException("Metadata entry already exists",
                                  name.c_str(),
                                  EEXIST);
    }

    FrontendPath path(find_path(parent));
    path /= name;

    maybe_add_to_cache_(path, dentry);
}
开发者ID:DarumasLegs,项目名称:volumedriver,代码行数:29,代码来源:MetaDataStore.cpp

示例5: obj

JSObject*
WrapperOwner::fromRemoteObjectVariant(JSContext* cx, const RemoteObject& objVar)
{
    ObjectId objId = ObjectId::deserialize(objVar.serializedId());
    RootedObject obj(cx, findCPOWById(objId));
    if (!obj) {

        // All CPOWs live in the privileged junk scope.
        RootedObject junkScope(cx, xpc::PrivilegedJunkScope());
        JSAutoRealm ar(cx, junkScope);
        RootedValue v(cx, UndefinedValue());
        // We need to setLazyProto for the getPrototype/getPrototypeIfOrdinary
        // hooks.
        ProxyOptions options;
        options.setLazyProto(true);
        obj = NewProxyObject(cx,
                             &CPOWProxyHandler::singleton,
                             v,
                             nullptr,
                             options);
        if (!obj)
            return nullptr;

        if (!cpows_.add(objId, obj))
            return nullptr;

        nextCPOWNumber_ = objId.serialNumber() + 1;

        // Incref once we know the decref will be called.
        incref();

        AuxCPOWData* aux = new AuxCPOWData(objId,
                                           objVar.isCallable(),
                                           objVar.isConstructor(),
                                           objVar.isDOMObject(),
                                           objVar.objectTag());

        SetProxyReservedSlot(obj, 0, PrivateValue(this));
        SetProxyReservedSlot(obj, 1, PrivateValue(aux));
    }

    if (!JS_WrapObject(cx, &obj))
        return nullptr;
    return obj;
}
开发者ID:,项目名称:,代码行数:45,代码来源:

示例6: MakeRemoteObject

static RemoteObject
MakeRemoteObject(JSContext* cx, ObjectId id, HandleObject obj)
{
    return RemoteObject(id.serialize(),
                        JS::IsCallable(obj),
                        JS::IsConstructor(obj),
                        dom::IsDOMObject(obj),
                        GetRemoteObjectTag(obj));
}
开发者ID:,项目名称:,代码行数:9,代码来源:

示例7: switch

void ToolManager::selectObject(ObjectId id, const QString &toolId)
{
    switch (id.type()) {
    case ObjectId::Invalid:
        return;
    case ObjectId::QObjectType:
    {
        QMutexLocker lock(Probe::objectLock());
        if (!Probe::instance()->isValidObject(id.asQObject()))
            return;

        Probe::instance()->selectObject(id.asQObject(), toolId);
        break;
    }
    case ObjectId::VoidStarType:
        Probe::instance()->selectObject(id.asVoidStar(), id.typeName());
        break;
    }
}
开发者ID:cometdlut,项目名称:GammaRay,代码行数:19,代码来源:toolmanager.cpp

示例8: objectIdMap

bool
WrapperAnswer::RecvDropObject(const ObjectId &objId)
{
    JSObject *obj = objects_.find(objId);
    if (obj) {
        objectIdMap(objId.hasXrayWaiver()).remove(obj);
        objects_.remove(objId);
    }
    return true;
}
开发者ID:arroway,项目名称:gecko-dev,代码行数:10,代码来源:WrapperAnswer.cpp

示例9: lookup_buffer

BufferRefVector ResoundSession::lookup_buffer(ObjectId id){
    BufferRefVector ret;
    if(id.find('.') != std::string::npos){
        BufferRefMap::iterator it = buffers_.find(id);
        if(it != buffers_.end()){
            ret.push_back(it->second);
        }
    } else {
        for(BufferRefMap::iterator it = buffers_.begin(); it != buffers_.end(); ++it){
            ObjectId s = it->first;
            ObjectId left = s.substr(0,s.find('.'));
            if(id == left){
                ret.push_back(it->second);
            }
            
        }
    }
    return ret;
}
开发者ID:drm004e,项目名称:resoundnv,代码行数:19,代码来源:core.cpp

示例10:

events::Event
FileSystemEvents::owner_changed(const ObjectId& oid,
                                const NodeId& new_owner_id)
{
    events::Event ev;
    auto msg = ev.MutableExtension(events::owner_changed);

    msg->set_name(oid.str());
    msg->set_new_owner_id(new_owner_id.str());

    return ev;
}
开发者ID:DarumasLegs,项目名称:volumedriver,代码行数:12,代码来源:FileSystemEvents.cpp

示例11: path

void
MetaDataStore::unlink(const ObjectId& id,
                      const std::string& name)
{
    LOG_TRACE(id);

    FrontendPath path(find_path(id));
    path /= name;

    harakoon_.erase(yt::UUID(id.str()), name);
    drop_from_cache(path);
}
开发者ID:DarumasLegs,项目名称:volumedriver,代码行数:12,代码来源:MetaDataStore.cpp

示例12: MakeRemoteObject

static RemoteObject
MakeRemoteObject(JSContext* cx, ObjectId id, HandleObject obj)
{
    nsCString objectTag;

    nsCOMPtr<nsIRemoteTagService> service =
        do_GetService("@mozilla.org/addons/remote-tag-service;1");
    if (service) {
        RootedValue objVal(cx, ObjectValue(*obj));
        service->GetRemoteObjectTag(objVal, objectTag);
    }

    return RemoteObject(id.serialize(),
                        JS::IsCallable(obj),
                        JS::IsConstructor(obj),
                        dom::IsDOMObject(obj),
                        objectTag);
}
开发者ID:Nazi-Nigger,项目名称:gecko-dev,代码行数:18,代码来源:WrapperOwner.cpp

示例13: makeObjectId

 ObjectId ObjectId::makeObjectId()
 {
    ObjectId oid;
    oid.gen();
    return oid;
 }
开发者ID:tynia,项目名称:BSON,代码行数:6,代码来源:oid.cpp

示例14: GetKeyForMap

uint32 SystemManager::GetKeyForMap(const ObjectId& id) const
{
	return id.GetId();
}
开发者ID:Bifido,项目名称:GameplayProgramming,代码行数:4,代码来源:SystemManager.cpp

示例15: hash_value

 std::size_t hash_value(const ObjectId& oid) {
     const CORBA::Octet* start = oid.get_buffer();
     return boost::hash_range(start, start+oid.length());
 }
开发者ID:RedhawkSDR,项目名称:framework-core,代码行数:4,代码来源:CorbaGC.cpp


注:本文中的ObjectId类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。