本文整理汇总了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;
}
示例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;
}
示例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));
}
示例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);
}
示例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;
}
示例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));
}
示例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;
}
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
示例13: makeObjectId
ObjectId ObjectId::makeObjectId()
{
ObjectId oid;
oid.gen();
return oid;
}
示例14: GetKeyForMap
uint32 SystemManager::GetKeyForMap(const ObjectId& id) const
{
return id.GetId();
}
示例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());
}