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


C++ connection函数代码示例

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


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

示例1: get_image_size

void CDoProcess::DoProcess(CMData* pData,SubTestResult *testItem)
{	
	try
	{

	Hobject   FindImage,ImageReduced,EllipseObj;
	Hobject  ModelRegions, ConnectedRegions, SelectedRegions,ModelImages,SelectedRegionsSize,RegionClosing,RegionUnion,RegionFillUp,RegionOpening;
	Hlong Contrast = m_Parameters.m_Contrast;


	HTuple Row2, Column2, Radius2;

	Hobject regional_Internal,regional_Out;


	get_image_size (pData->m_Image, &Column2, &Row2);
	gen_ellipse(&EllipseObj, Row2/2, Column2/2, 0, m_Parameters.LongAxis, m_Parameters.ShortAxis);
	if (ShowObject&&pData->m_isDebug)
	{
		set_color(pData->m_ShowHWindow,"yellow");	
		disp_obj(EllipseObj,pData->m_ShowHWindow);
	}
	reduce_domain(pData->m_Image, EllipseObj, &ImageReduced);
	inspect_shape_model(ImageReduced, &ModelImages, &ModelRegions, 1, Contrast);
	connection(ModelRegions, &ConnectedRegions);
	//**==============================================================
	//	**选择区域这条更改,原来默认是700,现在我想改成可调的,我现在就设的40
	select_shape(ConnectedRegions, &SelectedRegionsSize, "area", "and", m_Parameters.Select_Shape_Size, 99999);

	//	** 添加这句union1
	closing_circle (SelectedRegionsSize, &RegionClosing, 400.5);
	union1(RegionClosing, &RegionUnion);

	fill_up (RegionUnion, &RegionFillUp);
    opening_circle (RegionFillUp, &RegionOpening, m_Parameters.OutlierRemover+0.5);

	Hlong TempNumber;		  

	count_obj(RegionOpening,&TempNumber);

	  if (TempNumber<1)
	  {  
		  pData->m_isFail = true;
		  testItem->m_bFailSubTest = true;

		  if (pData->m_isDebug)
		  {
			  set_color(pData->m_ShowHWindow,"green");
			  set_tposition( pData->m_ShowHWindow,120, 0);
			#ifdef _ENGLISH
						  write_string(pData->m_ShowHWindow,"Shell center not found");
			#else
						  write_string(pData->m_ShowHWindow,"圆中心未找到");
			#endif
		  }
		  //pData->m_center_x=50;
		  //pData->m_center_y=50;
		  //pData->r_real=40;
		  //return;
	  }
		  
	//*==============================================================
	double  CenterRow, CenterColumn, CenterRadius;
	smallest_circle(RegionOpening, &CenterRow, &CenterColumn, &CenterRadius);


		  Hobject circle;
		  if ((m_Parameters.XMin<CenterColumn)&&(CenterColumn<m_Parameters.XMax)&&(m_Parameters.YMin<CenterRow)&&(CenterRow<m_Parameters.YMax)&&(CenterRadius<m_Parameters.RMax)&&(CenterRadius>m_Parameters.RMin))
		  {
			  pData->m_center_x=CenterColumn;
			  pData->m_center_y=CenterRow;
			  pData->r_real=CenterRadius;
			  set_color(pData->m_ShowHWindow,"cyan");
			  gen_circle(&circle, pData->m_center_y, pData->m_center_x, pData->r_real);
			  disp_obj(circle,pData->m_ShowHWindow);
		  }
		  else
		  {
			  pData->m_isFail = true;
			  testItem->m_bFailSubTest = true;
			  pData->m_center_x=50;
			  pData->m_center_y=50;
			  pData->r_real=40;
			  set_color(pData->m_ShowHWindow,"red");
			  gen_circle(&circle, pData->m_center_y, pData->m_center_x, pData->r_real);
			  disp_obj(circle,pData->m_ShowHWindow);

			  if (pData->m_isDebug)
			  {
					  set_color(pData->m_ShowHWindow,"green");
					  set_tposition( pData->m_ShowHWindow,5, 145);
					#ifdef _ENGLISH
						write_string(pData->m_ShowHWindow,"Fitted shell center not match the qualifications");
					#else
						write_string(pData->m_ShowHWindow,"拟合得到的圆的中心坐标及半径与限定条件不符");
					#endif

			  }
			  //return;

//.........这里部分代码省略.........
开发者ID:bblr001,项目名称:MVS,代码行数:101,代码来源:CenterHC23.cpp

示例2: main


//.........这里部分代码省略.........
    while((ch = getopt(argc, argv, "tp:a:l:o:w:s:d:")) != -1)
    {
        switch(ch)
        {
            case 't': usetcp = 1; break;
            case 'p': sscanf(optarg, "%hu", &port); break;
            case 'a': sscanf(optarg, "%lx", &bufpos); break;
            case 'l': buflen = atoi(optarg); break;
            case 'o': offset = atoi(optarg); break;
            case 's': timeout = atoi(optarg); break;
            case 'w': wipe = atoi(optarg); break;
            case 'd': type = atoi(optarg); break;
            default : usage(argv[0]);
        }
    }

    if(!(target = argv[optind]))
    {
        fprintf(stderr, "No target host specified\n");
        exit(EXIT_FAILURE);
    }

    if(type >= 0)
    {
        if(type >= sizeof types / sizeof types[0] - 1)
        {
            fprintf(stderr, "Invalid type\n");
            exit(EXIT_FAILURE);
        }

        sc = types[type].code;
        bufpos = types[type].bufpos;
        buflen = types[type].buflen;
        offset = types[type].offset;
        wipe = types[type].wipe;
    }

    if(!bufpos)
    {
        fprintf(stderr, "No buffer address specified\n");
        exit(EXIT_FAILURE);
    }

    bzero(&addr, sizeof addr);
    addr.sin_family = AF_INET;
    addr.sin_port = htons(port);
    addr.sin_addr = getip(target);

    tv.tv_sec = timeout;
    tv.tv_usec = 0;

    if(!usetcp)
    {
        clnt = clntudp_create(&addr, SM_PROG, SM_VERS, tv, &sockp);
        if(clnt == NULL)
        {
            clnt_pcreateerror("clntudp_create()");
            exit(EXIT_FAILURE);
        }
        tvr.tv_sec = 2;
        tvr.tv_usec = 0;
        clnt_control(clnt, CLSET_RETRY_TIMEOUT, (char *) &tvr);
    }
    else
    {
        clnt = clnttcp_create(&addr, SM_PROG, SM_VERS, &sockp, 0, 0);
        if(clnt == NULL)
        {
            clnt_pcreateerror("clnttcp_create()");
            exit(EXIT_FAILURE);
        }
    }

    /* AUTH_UNIX / AUTH_SYS authentication forgery */
    clnt->cl_auth = authunix_create("localhost", 0, 0, 0, NULL);

    buff = wizardry(sc, bufpos, buflen, offset, wipe);
    smname.mon_name = buff;

    res = clnt_call(clnt, SM_STAT, (xdrproc_t) xdr_sm_name,
        (caddr_t) &smname, (xdrproc_t) xdr_sm_stat_res,
        (caddr_t) &smres, tv);

    if(res != RPC_SUCCESS)
    {
        clnt_perror(clnt, "clnt_call()");
        printf("A timeout was expected. Attempting connection to shell..\n");
        sleep(5); connection(addr);
        printf("Failed\n");
    }
    else
    {
        printf("Failed - statd returned res_stat: (%s) state: %d\n",
                smres.res_stat ? "failure" : "success", smres.state);
    }

    free(buff);
    clnt_destroy(clnt);
    return -1;
}
开发者ID:B-Rich,项目名称:osf_db,代码行数:101,代码来源:statdx.c

示例3: while

void toResultField::poll(void)
{
    try
    {
        if (!toCheckModal(this))
            return ;
        if (Query && Query->poll())
        {
            while (Query->poll() && !Query->eof())
            {
                // For some MySQL statements (say "show create function aaa.bbb") more than one column is returned
                // and it is not possible to control that (or I do not know how to do it). This workaround will get
                // a required field (say 3rd) from a result set returned.
                int fieldNo = whichResultField; // by default this would be set to 1 in constructor
                while (fieldNo > 1)
                {
                    fieldNo--;
                    Query->readValue();
                }
                Unapplied += Query->readValue();

                // Read any remaining columns for queries with specific field to fetch.
                // This is primarily used for MySQL statements like "show create..." which
                // return different uncontrollable number of fields for different users.
                // If remaining fields are not fetched polling thread will loop.
                if (whichResultField > 1)
                    while (!Query->eof())
                        Query->readValue();
            }
            if (Unapplied.length() > THRESHOLD)
            {
                append(Unapplied);
                Unapplied = QString::null;
            }
            if (Query->eof())
            {
                delete Query;
                Query = NULL;
                Poll.stop();
                try
                {
                    // Code is formatted if it is set in preferences (Preferences->Editor Extensions) to
                    // indent (format) a read only code AND! if it is not a MySQL code because current
                    // TOra code parser/indenter does not work correctly with MySQL code (routines)
                    if (toConfigurationSingle::Instance().autoIndentRo() && !toIsMySQL(connection()))
                        setText(toSQLParse::indent(text() + Unapplied));
                    else
                        append(Unapplied);
                }
                TOCATCH
                Unapplied = QString::null;
            }
        }
    }
    catch (const QString &exc)
    {
        delete Query;
        Query = NULL;
        Poll.stop();
        toStatusMessage(exc);
    }
}
开发者ID:netrunner-debian-kde-extras,项目名称:tora,代码行数:62,代码来源:toresultfield.cpp

示例4: xcb_get_window_attributes

xcb_window_t QXcbDrag::findRealWindow(const QPoint & pos, xcb_window_t w, int md, bool ignoreNonXdndAwareWindows)
{
    if (w == shapedPixmapWindow()->handle()->winId())
        return 0;

    if (md) {
        xcb_get_window_attributes_cookie_t cookie = xcb_get_window_attributes(xcb_connection(), w);
        xcb_get_window_attributes_reply_t *reply = xcb_get_window_attributes_reply(xcb_connection(), cookie, 0);
        if (!reply)
            return 0;

        if (reply->map_state != XCB_MAP_STATE_VIEWABLE)
            return 0;

        free(reply);

        xcb_get_geometry_cookie_t gcookie = xcb_get_geometry(xcb_connection(), w);
        xcb_get_geometry_reply_t *greply = xcb_get_geometry_reply(xcb_connection(), gcookie, 0);
        if (!greply)
            return 0;

        QRect windowRect(greply->x, greply->y, greply->width, greply->height);
        free(greply);
        if (windowRect.contains(pos)) {
            bool windowContainsMouse = !ignoreNonXdndAwareWindows;
            {
                xcb_get_property_cookie_t cookie =
                        Q_XCB_CALL(xcb_get_property(xcb_connection(), false, w, connection()->atom(QXcbAtom::XdndAware),
                                                    XCB_GET_PROPERTY_TYPE_ANY, 0, 0));
                xcb_get_property_reply_t *reply = xcb_get_property_reply(xcb_connection(), cookie, 0);

                bool isAware = reply && reply->type != XCB_NONE;
                free(reply);
                if (isAware) {
                    const QPoint relPos = pos - windowRect.topLeft();
                    // When ShapeInput and ShapeBounding are not set they return a single rectangle with the geometry of the window, this is why we
                    // need to check both here so that in the case one is set and the other is not we still get the correct result.
                    if (connection()->hasInputShape())
                        windowContainsMouse = windowInteractsWithPosition(xcb_connection(), relPos, w, XCB_SHAPE_SK_INPUT);
                    if (windowContainsMouse && connection()->hasXShape())
                        windowContainsMouse = windowInteractsWithPosition(xcb_connection(), relPos, w, XCB_SHAPE_SK_BOUNDING);
                    if (!connection()->hasInputShape() && !connection()->hasXShape())
                        windowContainsMouse = true;
                    if (windowContainsMouse)
                        return w;
                }
            }

            xcb_query_tree_cookie_t cookie = xcb_query_tree (xcb_connection(), w);
            xcb_query_tree_reply_t *reply = xcb_query_tree_reply(xcb_connection(), cookie, 0);

            if (!reply)
                return 0;
            int nc = xcb_query_tree_children_length(reply);
            xcb_window_t *c = xcb_query_tree_children(reply);

            xcb_window_t r = 0;
            for (uint i = nc; !r && i--;)
                r = findRealWindow(pos - windowRect.topLeft(), c[i], md-1, ignoreNonXdndAwareWindows);

            free(reply);
            if (r)
                return r;

            // We didn't find a client window!  Just use the
            // innermost window.

            // No children!
            if (!windowContainsMouse)
                return 0;
            else
                return w;
        }
    }
    return 0;
}
开发者ID:Drakey83,项目名称:steamlink-sdk,代码行数:76,代码来源:qxcbdrag.cpp

示例5: locker

QDBusConnectionPrivate *QDBusConnectionManager::sender() const
{
    QMutexLocker locker(&senderMutex);
    return connection(senderName);
}
开发者ID:Akheon23,项目名称:chromecast-mirrored-source.vendor,代码行数:5,代码来源:qdbusconnection.cpp

示例6: pn_link_attachments

void link::handler(class handler &h) {
    pn_record_t *record = pn_link_attachments(pn_cast(this));
    connection_context& cc(connection_context::get(pn_cast(&connection())));
    counted_ptr<pn_handler_t> chandler = cc.container_impl->cpp_handler(&h);
    pn_record_set_handler(record, chandler.get());
}
开发者ID:b-cuts,项目名称:qpid-proton,代码行数:6,代码来源:link.cpp

示例7: oldServer

void KviIrcContext::connectionTerminated()
{
	if(!m_pConnection)
		return; // this may happen in the destructor!

	KviIrcServer oldServer(*(connection()->target()->server()));

	oldServer.clearReconnectInfo();

	KviIrcServerReconnectInfo info;

	info.m_szNick = connection()->userInfo()->isAway() ? connection()->userInfo()->nickNameBeforeAway() : connection()->userInfo()->nickName();
	info.m_szPass = connection()->userInfo()->password();
	info.m_bIsAway = connection()->userInfo()->isAway();
	info.m_szAwayReason = connection()->userInfo()->awayReason();

	connection()->requestQueue()->clearAll();

	// we consider it unexpected when we haven't sent a QUIT message and we're connected
	// or alternatively when a simulation of such a termination is requested (this is used to keep the queries open etc.)
	bool bUnexpectedDisconnect = ((!(connection()->stateData()->sentQuit())) && ((m_eState == KviIrcContext::Connected) || (m_eState == KviIrcContext::Connecting) || (m_eState == KviIrcContext::LoggingIn))) || connection()->stateData()->simulateUnexpectedDisconnect();

	if(bUnexpectedDisconnect)
	{
		if(KVI_OPTION_BOOL(KviOption_boolAutoReconnectOnUnexpectedDisconnect))
		{
			if(KVI_OPTION_BOOL(KviOption_boolRejoinChannelsAfterReconnect))
				connection()->gatherChannelAndPasswordPairs(info.m_lJoinChannels);

			if(KVI_OPTION_BOOL(KviOption_boolReopenQueriesAfterReconnect))
				connection()->gatherQueryNames(info.m_lOpenQueries);
		}

		if(KVI_OPTION_BOOL(KviOption_boolKeepChannelsOpenOnUnexpectedDisconnect) || KVI_OPTION_BOOL(KviOption_boolKeepChannelsOpenOnDisconnect))
			connection()->keepChannelsOpenAfterDisconnect();

		if(KVI_OPTION_BOOL(KviOption_boolKeepQueriesOpenOnUnexpectedDisconnect) || KVI_OPTION_BOOL(KviOption_boolKeepQueriesOpenOnDisconnect))
			connection()->keepQueriesOpenAfterDisconnect();
	}
	else
	{
		if(KVI_OPTION_BOOL(KviOption_boolKeepChannelsOpenOnDisconnect))
			connection()->keepChannelsOpenAfterDisconnect();

		if(KVI_OPTION_BOOL(KviOption_boolKeepQueriesOpenOnDisconnect))
			connection()->keepQueriesOpenAfterDisconnect();
	}

	bool bStopOutput = false;

	bStopOutput = KVS_TRIGGER_EVENT_0_HALTED(KviEvent_OnIRCConnectionTerminated, m_pConsole);

	if(!bStopOutput)
	{
		m_pConsole->output(KVI_OUT_CONNECTION, __tr2qs("Connection terminated [%s (%s:%u)]"),
		    oldServer.hostName().toUtf8().data(),
		    oldServer.ip().toUtf8().data(),
		    oldServer.port());
	}

	// do reconnect

	if(bUnexpectedDisconnect && KVI_OPTION_BOOL(KviOption_boolAutoReconnectOnUnexpectedDisconnect))
	{
		setState(PendingReconnection);

		//m_uConnectAttemptCount = 1;
		if(!_OUTPUT_MUTE)
			m_pConsole->output(KVI_OUT_CONNECTION, __tr2qs("The connection terminated unexpectedly. Trying to reconnect..."));

		KviAsynchronousConnectionData * d = new KviAsynchronousConnectionData();
		d->szServerId = oldServer.id();
		d->szServer = oldServer.hostName();
		d->uPort = oldServer.port();
		d->bPortIsOk = true;
		d->bUseIPv6 = oldServer.isIPv6();
		d->bUseSSL = oldServer.useSSL();
		d->bSTARTTLS = oldServer.enabledSTARTTLS();
		d->szPass = oldServer.password();
		d->szInitUMode = oldServer.initUMode();
		d->m_pReconnectInfo = new KviIrcServerReconnectInfo(info);

		setAsynchronousConnectionData(d);

		beginAsynchronousConnect(1000 * KVI_OPTION_UINT(KviOption_uintAutoReconnectDelay));
	}
	else
	{
		setState(Idle);
	}
}
开发者ID:AndrioCelos,项目名称:KVIrc,代码行数:91,代码来源:KviIrcContext.cpp

示例8: Q_XCB_NOOP

void QXcbShmImage::put(xcb_window_t window, const QPoint &target, const QRect &source)
{
    Q_XCB_NOOP(connection());
    if (m_gc_window != window) {
        if (m_gc)
            Q_XCB_CALL(xcb_free_gc(xcb_connection(), m_gc));

        m_gc = xcb_generate_id(xcb_connection());
        Q_XCB_CALL(xcb_create_gc(xcb_connection(), m_gc, window, 0, 0));

        m_gc_window = window;
    }

    Q_XCB_NOOP(connection());
    if (m_shm_info.shmaddr) {
        xcb_image_shm_put(xcb_connection(),
                          window,
                          m_gc,
                          m_xcb_image,
                          m_shm_info,
                          source.x(),
                          source.y(),
                          target.x(),
                          target.y(),
                          source.width(),
                          source.height(),
                          false);
    } else {
        // If we upload the whole image in a single chunk, the result might be
        // larger than the server's maximum request size and stuff breaks.
        // To work around that, we upload the image in chunks where each chunk
        // is small enough for a single request.
        int src_x = source.x();
        int src_y = source.y();
        int target_x = target.x();
        int target_y = target.y();
        int width = source.width();
        int height = source.height();

        // We must make sure that each request is not larger than max_req_size.
        // Each request takes req_size + m_xcb_image->stride * height bytes.
        uint32_t max_req_size = xcb_get_maximum_request_length(xcb_connection());
        uint32_t req_size = sizeof(xcb_put_image_request_t);
        int rows_per_put = (max_req_size - req_size) / m_xcb_image->stride;

        // This assert could trigger if a single row has more pixels than fit in
        // a single PutImage request. However, max_req_size is guaranteed to be
        // at least 16384 bytes. That should be enough for quite large images.
        Q_ASSERT(rows_per_put > 0);

        while (height > 0) {
            int rows = std::min(height, rows_per_put);

            xcb_image_t *subimage = xcb_image_subimage(m_xcb_image, src_x, src_y, width, rows,
                                                       0, 0, 0);
            xcb_image_put(xcb_connection(),
                          window,
                          m_gc,
                          subimage,
                          target_x,
                          target_y,
                          0);

            xcb_image_destroy(subimage);

            src_y += rows;
            target_y += rows;
            height -= rows;
        }
    }
    Q_XCB_NOOP(connection());

    m_dirty = m_dirty | source;

    xcb_flush(xcb_connection());
    Q_XCB_NOOP(connection());
}
开发者ID:CodeDJ,项目名称:qt5-hidpi,代码行数:77,代码来源:qxcbbackingstore.cpp

示例9: connection

void KviIrcMessage::parseMessageTags()
{
	if(m_szMessageTags.isEmpty())
		return;
	KviCString szKey;
	KviCString szValue;
	for(int i = 0; i < m_szMessageTags.len(); ++i)
	{
		if(m_szMessageTags.at(i) == '=')
		{
			for(++i; i < m_szMessageTags.len(); ++i)
			{
				if(m_szMessageTags.at(i) == ';')
				{
					m_ParsedMessageTags[connection()->decodeText(szKey)] = connection()->decodeText(szValue);
					szKey.clear();
					szValue.clear();
					break;
				}
				else if(m_szMessageTags.at(i) == '\\')
				{
					if(++i >= m_szMessageTags.len())
						break;
					switch(m_szMessageTags.at(i))
					{
						case ':':
							szValue += ';';
							break;
						case 's':
							szValue += ' ';
							break;
						case '0':
							szValue += '\0';
							break;
						case 'r':
							szValue += '\r';
							break;
						case 'n':
							szValue += '\n';
							break;
						default:
							szValue += m_szMessageTags.at(i);
					}
				}
				else
				{
					szValue += m_szMessageTags.at(i);
				}
			}
		}
		else if(m_szMessageTags.at(i) == ';')
		{
			// Insert key without value
			m_ParsedMessageTags[connection()->decodeText(szKey)].clear();
			szKey.clear();
		}
		else
		{
			szKey += m_szMessageTags.at(i);
		}
	}
	m_ParsedMessageTags[connection()->decodeText(szKey)] = connection()->decodeText(szValue);

	m_time = QDateTime::fromString(m_ParsedMessageTags.value("time"), Qt::ISODate); // empty value will be invalid time
}
开发者ID:beigexperience,项目名称:KVIrc,代码行数:65,代码来源:KviIrcMessage.cpp

示例10: dbids

void toAWR::execute(void)
{
    try
    {
        //QString sql=Statement->text();
        //toQList params=toParamGet::getParam(this,sql);
        //Result->query(sql,params);
        //Result->query(sql,toQList());

        QVariant vdbid = dbid->itemData(dbid->currentIndex());
        QString dbids( vdbid.toStringList().at(0) );
        QString insts( vdbid.toStringList().at(1) );

        QVariant vf = fsnap->itemData(fsnap->currentIndex());
        QVariant vt = tsnap->itemData(tsnap->currentIndex());
        QString fsnaps( vf.toStringList().at(2) );
        QString tsnaps( vt.toStringList().at(2) );
//      toQList params;
//      params.push_back(fsnaps);
//      params.push_back(tsnaps);
        TLOG(0, toDecorator, __HERE__)
                << "Dbid:" << dbids.toLatin1().constData() << ' '
                << "Inst:" << insts.toLatin1().constData() << ' '
                << "fsnap:" << fsnaps.toLatin1().constData() << ' '
                << "tsnap:" << tsnaps.toLatin1().constData() << std::endl;

        try
        {
            toConnectionSubLoan c(connection());
            toQuery checkSnaps(c, SQLCheckSnaps, toQueryParams() << dbids << insts << fsnaps << tsnaps);

            toQuery report(c,
                           "select NVL(output,' ') \n"
                           //"from table(dbms_workload_repository.awr_report_text( \n"
                           "from table(dbms_workload_repository.awr_report_html( \n"
                           "               :dbid<char[40],in>, \n"
                           "               :inst<char[40],in>, \n"
                           "               :f<char[40],in>,    \n"
                           "               :t<char[40],in>, 0))",
                           toQueryParams() << dbids << insts << fsnaps << tsnaps);

            QString reports;
            while (!report.eof())
            {
                QString line = (QString)report.readValue();
                reports += line;
                reports += '\n';
            }
            std::cerr << reports.toLatin1().constData() << std::endl;

            QWidget *box = new QWidget(Tabs);
            QVBoxLayout *vbox = new QVBoxLayout;
            vbox->setSpacing(0);
            vbox->setContentsMargins(0, 0, 0, 0);
            box->setLayout(vbox);

            vbox->addWidget(new QLabel(tr("AWR report"), box));
            toTextView *tb = new toTextView(box);
            tb->setFontFamily("monospace");
            tb->setReadOnly(true);
            tb->setText(reports);

            vbox->addWidget(tb);
            Tabs->addTab(box, tr("AWR Report"));

        }
        catch (const toConnection::exception &t )
        {
            TOMessageBox::information(this, t, t);
        }

    }
    TOCATCH
}
开发者ID:doniexun,项目名称:tora,代码行数:74,代码来源:toawr.cpp

示例11: sendCommand

/*!
    Sends a \a command to the server.

    This method is provided for convenience. It is equal to:
    \code
    IrcConnection* connection = buffer->connection();
    connection->sendCommand(command);
    \endcode

    \sa IrcConnection::sendCommand()
 */
bool IrcBuffer::sendCommand(IrcCommand* command)
{
    if (IrcConnection* c = connection())
        return c->sendCommand(command);
    return false;
}
开发者ID:vitalyster,项目名称:libcommuni-gbp,代码行数:17,代码来源:ircbuffer.cpp

示例12: pn_link_attachments

void link::handler(proton_handler &h) {
    pn_record_t *record = pn_link_attachments(pn_object());
    internal::pn_ptr<pn_handler_t> chandler = connection().container().impl_->cpp_handler(&h);
    pn_record_set_handler(record, chandler.get());
}
开发者ID:Barba-studio,项目名称:qpid-proton,代码行数:5,代码来源:link.cpp

示例13: main

int main(int argc, char *argv[])
{
bmd_conf *konfiguracja=NULL;
struct soap soap;
int result;
char *serverURL = NULL;
char *host = NULL;
long int ssl_enabled=0;
long int authenticate=0;
char *keyfile=NULL;
char *keyfile_passwd=NULL;
char *keyfile_ssl=NULL;
char *keyfile_passwd_ssl=NULL;
char *cacert=NULL;
char *capath=NULL;
char *nrRoli=NULL;
int status = 0;

struct xsd__base64Binary *base64Cert = NULL;
char *serverResponse = NULL;
char *roleId=NULL;
int i=0;

	_GLOBAL_debug_level=0;
	if (argc==5)
	{
		for (i=1; i<argc; i++)
		{
			if (strcmp(argv[i],"-d")==0)
			{
				if (argc>i+1) _GLOBAL_debug_level=atoi(argv[i+1]);
			}
			if (strcmp(argv[i],"-p")==0)
			{
				asprintf(&roleId, "%s", argv[i+1]);
			}
		}
	}
	else
	{
		printf("%s\n",argv[0]);
		printf("\nniepoprawne wywołanie\n\nuzyj ponizszych parametrow\n");
		printf("-------------------------------------------------------\n");
		printf("\t-d liczba\tpoziom logowania\n");
		printf("\t-p liczba\tid roli\n");
		printf("-------------------------------------------------------\n");
		return -1;
	}

	/*załadowanie bibliotek ssl-owych*/
	SSL_load_error_strings();
        SSL_library_init();

	/*funkcje konfiguracyjne*/
	load_soap_configuration(&konfiguracja);
	configuration(konfiguracja,&host,&keyfile,&keyfile_passwd,&keyfile_ssl,&keyfile_passwd_ssl,&cacert,&capath,&ssl_enabled);

	/*funkcja ustanowienia połaczenia z serwerem*/
	status=connection(&soap,ssl_enabled,authenticate,keyfile_ssl,keyfile_passwd_ssl,cacert,capath);
	if (status!=SOAP_OK)
	{
		PRINT_DEBUG("SOAPCLIENTERR Connection error\n");
		return 0;
	}

	/*********************/
	/* informacja o roli */
	/*********************/
	struct bmd230__singleRoleInfo *roleInfo = NULL;

	roleInfo = (struct bmd230__singleRoleInfo *)malloc(sizeof(struct bmd230__singleRoleInfo));
 	roleInfo->roleName=NULL;
 	roleInfo->roleId=NULL;

	roleInfo->roleActionList=(struct bmd230__stringList *)malloc(sizeof(struct bmd230__stringList));
	roleInfo->roleActionList->__size=300;
	roleInfo->roleActionList->__ptr=(xsd__string *)malloc(sizeof(xsd__string)*roleInfo->roleActionList->__size);
	for (i=0; i<300; i++)
	{
		asprintf(&nrRoli, "%i", i+1);
		roleInfo->roleActionList->__ptr[i]=nrRoli;
	}

	roleInfo->roleRightsOids=(struct bmd230__stringList *)malloc(sizeof(struct bmd230__stringList));
	roleInfo->roleRightsOids->__size=0;
	roleInfo->roleRightsOids->__ptr=(xsd__string *)malloc(sizeof(xsd__string)*roleInfo->roleRightsOids->__size);
// 	roleInfo->roleRightsOids->__ptr[0]="rr_1_2_616_1_113527_4_3_3_8";

	roleInfo->roleRightsCodes=(struct bmd230__stringList *)malloc(sizeof(struct bmd230__stringList));
	roleInfo->roleRightsCodes->__size=0;
	roleInfo->roleRightsCodes->__ptr=(xsd__string *)malloc(sizeof(xsd__string)*roleInfo->roleRightsCodes->__size);
// 	roleInfo->roleRightsCodes->__ptr[0]="000000011";


	GenBuf_t *cert_pem=NULL;
	base64Cert = (struct xsd__base64Binary *)malloc(sizeof(struct xsd__base64Binary));
	status = bmd_load_binary_content(keyfile,&cert_pem);

	if (status != BMD_OK)
	{
//.........这里部分代码省略.........
开发者ID:unizeto,项目名称:bmd,代码行数:101,代码来源:bmdsoap_test_UpdateRole_ssl_auth.c

示例14: connection

void toResultDrawing::query(const QString &, toQueryParams const& params)
{
    toResult::setParams(params);
    typedef QPair<QString, QString> Reference;
    toConnection &conn = connection();

    m_dotGraphView->initEmpty();
    QString schema(params.at(0)), table(params.at(1));
    QSet<QString> tables;
    QSet<Reference> references;

    tables.insert(table);

    DotGraph newGraph("dot");
    QMap<QString,QString> ga;
    ga["id"] = "Schema";
    ga["compound"] = "true";
    ga["shape"] = "box";
    ga["rankdir"] = "BT"; // BOTTOM to TOP arrows

    newGraph.setGraphAttributes(ga);

    toQValue c1, c2, c3, c4, c5, c6, c7, c8, c9;
    // TODO: use toCache here - additional attributes
    toConnectionSubLoan c(conn);
    toQuery QueryC(c, SQLTableFKWithDistance, toQueryParams() << schema.toUpper() << distance << table.toUpper());
    while (!QueryC.eof())
    {
        c1 = QueryC.readValue();
        c2 = QueryC.readValue();
        c3 = QueryC.readValue();
        c4 = QueryC.readValue();
        c5 = QueryC.readValue();
        c6 = QueryC.readValue();
        c7 = QueryC.readValue();
        c8 = QueryC.readValue();
        c9 = QueryC.readValue();

        if ( c5.isNull() && c1.isNull())
        {
            // Here collect FK details (a column list for compound keys)
        }

        if ( c5.isNull() && !c1.isNull()) // c5 (column_name) is null - see rollup def
        {
            tables.insert((QString)c4); // table_name
            tables.insert((QString)c7); // r_table_name
            references.insert( Reference((QString)c4, (QString)c7));
        }
    }


    Q_FOREACH(QString const&t, tables)
    {
        QMap<QString,QString> ta; // table atributes
        ta["name"] = t;
        ta["label"] = t;
        ta["fontsize"] = "12";
        ta["comment"]= t;
        ta["id"]= t;
        ta["tooltip"] = t;
        newGraph.addNewNode(ta);
    }
开发者ID:Daniel1892,项目名称:tora,代码行数:63,代码来源:toresultdrawing.cpp

示例15: main

int main()
{
bmd_conf *konfiguracja=NULL;

char *serverURL = NULL;
char *host = NULL;
long int ssl_enabled=0;
long int authenticate=0;
char *keyfile=NULL;
char *keyfile_passwd=NULL;
char *keyfile_ssl=NULL;
char *keyfile_passwd_ssl=NULL;
char *cacert=NULL;
char *capath=NULL;
int status = 0;
struct bmd230__mtdsSearchValues *mtds = NULL;
struct bmd230__mtdsValues *formMtds = NULL;
struct bmd230__searchSortInfoList *sortInfo;
struct bmd230__searchResults *searchResults = NULL;
struct xsd__base64Binary *base64Cert = NULL;

int iter=0;
int jupiter=0;

#ifdef ENABLE_WS_SECURITY
bmdWSSecurityClient_t WSSEclientStruct;
#endif /*ifdef ENABLE_WS_SECURITY*/
struct soap *soap = soap_new1(SOAP_XML_CANONICAL); /// !!!!istotne aby wlaczona postac kanoninczna

	/*zaladowanie bibliotek ssl-owych*/
	SSL_load_error_strings();
        SSL_library_init();


	/*funkcje konfiguracyjne*/
	load_soap_configuration(&konfiguracja);
	configuration(konfiguracja,&host,&keyfile,&keyfile_passwd,&keyfile_ssl,&keyfile_passwd_ssl,&cacert,&capath,&ssl_enabled);

	/*funkcja ustanowienia połaczenia z serwerem*/
	status=connection(soap,ssl_enabled,authenticate,keyfile_ssl,keyfile_passwd_ssl,cacert,capath);
	if (status!=SOAP_OK)
	{
		printf("SOAPCLIENTERR Connection error\n");
		return 0;
	}

#ifdef ENABLE_WS_SECURITY	
	/**WS SECURITY BEGIN ******/
	status=WSSecurity_client_init(soap, "wszczygiel072010_priv.pem", "12345678", "wszczygiel072010_cert.pem", "HereYouCanSetUserName", "HerYouCanSetPassword", &WSSEclientStruct);
	if(status != 0)
	{
		printf("WS Security client side error\n");
		return -1;
	}
	/**WS SECURITY END   ******/
#endif /*ifdef ENABLE_WS_SECURITY*/

	/*formularz - wydobywane metadane*/
	formMtds = (struct bmd230__mtdsValues *)malloc(sizeof(struct bmd230__mtdsValues));
 	formMtds->__size = 2;
 	formMtds->__ptr = (struct bmd230__mtdSingleValue *)malloc(sizeof(struct bmd230__mtdSingleValue)*(formMtds->__size));

	/*wlasciciel*/
 	formMtds->__ptr[0].mtdOid = OID_SYS_METADATA_CRYPTO_OBJECTS_OWNER;
	formMtds->__ptr[0].mtdValue = "";
	formMtds->__ptr[0].mtdDesc = "";
	/*numer faktury*/
	formMtds->__ptr[1].mtdOid = "1.2.616.1.113527.4.3.3.1";
	formMtds->__ptr[1].mtdValue = "";
	formMtds->__ptr[1].mtdDesc = "";

	
	

	/*przygotowanie danych niezbędnych do uruchomienia funkcji web-owej*/
 	mtds = (struct bmd230__mtdsSearchValues *)malloc(sizeof(struct bmd230__mtdsSearchValues));
 	mtds->__size = 3;
	mtds->__ptr=(struct bmd230__mtdSearchSingleValue*)malloc(sizeof(struct bmd230__mtdSearchSingleValue)*mtds->__size);
	
	
	mtds->__ptr[0].mtdOid = OID_ACTION_METADATA_USER_CLASS;
  	mtds->__ptr[0].mtdValue = "2";
  	mtds->__ptr[0].mtdStatement = NULL; //"POSITIVE";
	mtds->__ptr[0].mtdAdjustment = NULL;//"NONE";
	mtds->__ptr[0].noOfOpenBrackets = 0;
	mtds->__ptr[0].noOfCloseBrackets = 0;
	mtds->__ptr[0].mtdDesc = NULL; //"LIKE";
	mtds->__ptr[0].mtdLogicalOperator = NULL;
	

	mtds->__ptr[1].mtdOid = OID_ACTION_METADATA_ACTION;
	mtds->__ptr[1].mtdValue = "16";
	mtds->__ptr[1].mtdStatement = NULL; //"POSITIVE";
	mtds->__ptr[1].mtdAdjustment = NULL; //"NONE";
	mtds->__ptr[1].noOfOpenBrackets = 0;
	mtds->__ptr[1].noOfCloseBrackets = 0;
	mtds->__ptr[1].mtdDesc = NULL; //"LIKE";
	mtds->__ptr[1].mtdLogicalOperator = NULL; //"AND";
	
	
//.........这里部分代码省略.........
开发者ID:unizeto,项目名称:bmd,代码行数:101,代码来源:bmdsoap_test_SearchUnreceived_ssl_auth.c


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