• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ handle类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: delslice

BOOST_PYTHON_DECL void delslice(object const& target, handle<> const& begin, handle<> const& end)
{
    if (assign_slice(
            target.ptr(), begin.get(), end.get(), 0) == -1
        )
    {
        throw_error_already_set();
    }
}
开发者ID:RossBille,项目名称:vim-config,代码行数:9,代码来源:object_protocol.cpp


示例2: handle

inline handle::handle(handle const& other)
  : m_interpreter(other.m_interpreter)
  , m_index(LUA_NOREF)
{
    if (m_interpreter == 0) return;
    other.push(m_interpreter);
    m_index = luaL_ref(m_interpreter, LUA_REGISTRYINDEX);
}
开发者ID:Jedzia,项目名称:Humbug,代码行数:8,代码来源:handle.hpp


示例3: create

    static attribute create(handle const& loc, const char* name,
			    datatype const& type, dataspace const& space)
    {
      hid_t id = H5Acreate(loc.getId(), name, type, space,
			   H5P_DEFAULT, H5P_DEFAULT);
      assert(id >= 0);
      return attribute(std::move(id));
    }
开发者ID:andreabedini,项目名称:isaw-sq-flatperm,代码行数:8,代码来源:attribute.hpp


示例4: get_attribute

  attribute get_attribute(handle const& loc,
			  const char* obj_name,
			  const char* attr_name)
  {
    hid_t id = H5Aopen_by_name(loc.getId(), obj_name, attr_name,
			       H5P_DEFAULT, H5P_DEFAULT);
    if (id < 0) throw std::runtime_error("H5Aopen_by_name failed");
    return attribute(std::move(id));
  }
开发者ID:andreabedini,项目名称:isaw-sq-flatperm,代码行数:9,代码来源:attribute.hpp


示例5: wlan_enum_interfaces

wlan_if_list wlan_enum_interfaces(handle const& h)
{
	WLAN_INTERFACE_INFO_LIST* iflist = nullptr;
	DWORD res;

	res = ::WlanEnumInterfaces(h.get(), nullptr, &iflist);
	if (res == ERROR_SUCCESS)
		return wlan_if_list(iflist, ::WlanFreeMemory);

	boost::throw_exception(boost::system::system_error(res,
													   boost::system::system_category(),
													   "win::wlan_enum_interfaces"));
	return wlan_if_list();
}
开发者ID:ATNoG,项目名称:ODTONE,代码行数:14,代码来源:win32.cpp


示例6: python_get_error

string python_get_error(handle<> exType, handle<> val, handle<> trace)
{
    string msg("Python: ");
    try
    {
        if (val)
        {
            if (const char* str = to_string(val.get()))
            {
                msg += str;
            }
        }
        else if (exType)
        {
            msg += to_string(exType.get());
        }

        PycString_IMPORT;
        if (trace && PycStringIO)
        {
            object traceOut(handle<>(PycStringIO->NewOutput(128)));
            PyTraceBack_Print(trace.get(), traceOut.ptr());
            msg += "\n";
            msg += PyString_AsString(object(
                handle<>(PycStringIO->cgetvalue(traceOut.ptr()))).ptr());
        }
    }
    catch (const exception& e)
    {
        msg += e.what() + string(__func__);
    }
    catch (...)
    {
        msg += "Unknown error in " + string(__func__);
    }
    return msg;
}
开发者ID:Panke,项目名称:zerobugs,代码行数:37,代码来源:handle_error.cpp


示例7: exception

void function::argument_error(PyObject* args, PyObject* /*keywords*/) const
{
    static handle<> exception(
        PyErr_NewException(const_cast<char*>("Boost.Python.ArgumentError"), PyExc_TypeError, 0));

    object message = "Python argument types in\n    %s.%s("
        % make_tuple(this->m_namespace, this->m_name);
    
    list actual_args;
    for (ssize_t i = 0; i < PyTuple_Size(args); ++i)
    {
        char const* name = PyTuple_GetItem(args, i)->ob_type->tp_name;
        actual_args.append(str(name));
    }
    message += str(", ").join(actual_args);
    message += ")\ndid not match C++ signature:\n    ";
    message += str("\n    ").join(signatures());

#if BOOST_PYTHON_DEBUG_ERROR_MESSAGES
    std::printf("\n--------\n%s\n--------\n", extract<const char*>(message)());
#endif 
    PyErr_SetObject(exception.get(), message.ptr());
    throw_error_already_set();
}
开发者ID:Alexander--,项目名称:Wesnoth-1.8-for-Android,代码行数:24,代码来源:function.cpp


示例8: wlan_register_notification

void wlan_register_notification(handle const& h, wlan_register_notification_handler const& handler)
{
	wlan_register_notification_handler* cb = new wlan_register_notification_handler(handler);
	DWORD res;

	res = ::WlanRegisterNotification(h.get(), WLAN_NOTIFICATION_SOURCE_ALL, TRUE,
									 detail::wlan_notify_handler, cb,
									 nullptr, nullptr);
	if (res == ERROR_SUCCESS)
		return;

	delete cb;
	boost::throw_exception(boost::system::system_error(res,
													   boost::system::system_category(),
													   "win::wlan_register_notification"));
}
开发者ID:ATNoG,项目名称:ODTONE,代码行数:16,代码来源:win32.cpp


示例9: unwrap

 static void unwrap(lua_State* L, handle const& value)
 {
     value.push(L);
 }
开发者ID:Jedzia,项目名称:Humbug,代码行数:4,代码来源:handle.hpp


示例10: unwrap

 static void unwrap(lua_State* interpreter, handle const& value)
 {
     value.push(interpreter);
 }
开发者ID:jiangguang5201314,项目名称:ZNginx,代码行数:4,代码来源:handle.hpp


示例11: is_simple

// 1枚の絵 - 通常の画像であるかチェック
inline
bool is_simple(handle const& i) {
	return i.count() == 1;
}
开发者ID:Ochieng,项目名称:AnimationMaker,代码行数:5,代码来源:graphics_loader_base.hpp


示例12: getslice

BOOST_PYTHON_DECL object getslice(object const& target, handle<> const& begin, handle<> const& end)
{
    return object(
        detail::new_reference(
            apply_slice(target.ptr(), begin.get(), end.get())));
}
开发者ID:RossBille,项目名称:vim-config,代码行数:6,代码来源:object_protocol.cpp


示例13: apply_to_own_type

handle<> apply_to_own_type(handle<> x)
{
    // Tests that we can return handle<> from a callback and that we
    // can pass arbitrary handle<T>.
    return call<handle<> >(x.get(), type_handle(borrowed(x->ob_type)));
}
开发者ID:DD-L,项目名称:deel.boost.python,代码行数:6,代码来源:callbacks.cpp


示例14: process

 /**
  * Constructs a new process object.
  *
  * Creates a new process object that represents a running process
  * within the system.
  *
  * This operation is only available on Windows systems. The handle is
  * closed when the process instance (and all of its copies) is destroyed.
  */
 process(handle h)
     : id_(GetProcessId(h.native())),
     handle_(h)
 {
 }
开发者ID:BitMoneta,项目名称:fc,代码行数:14,代码来源:process.hpp


示例15: handle

 handle(handle<Y> const& r)
     : m_p(python::xincref(python::upcast<T>(r.get())))
 {
 }
开发者ID:Niko-r,项目名称:geofeatures,代码行数:4,代码来源:handle.hpp


示例16: swap

inline void swap(handle &a, handle &b) noexcept { a.swap(b); }
开发者ID:bunsanorg,项目名称:process,代码行数:1,代码来源:handle.hpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ hash类代码示例发布时间:2022-05-31
下一篇:
C++ h256类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap