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

C++ sid函数代码示例

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

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



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

示例1: sid

int CSkypeProto::RevokeAuth(WPARAM wParam, LPARAM lParam)
{
	CContact::Ref contact;
	MCONTACT hContact = (MCONTACT)wParam;
	SEString sid(_T2A(::db_get_wsa(hContact, this->m_szModuleName, SKYPE_SETTINGS_SID)));
	if (this->GetContact(sid, contact))
	{
		if (contact->SetBuddyStatus(false))
			this->setByte(hContact, "Grant", 1);
		this->contactList.remove_val(contact);
	}

	return 0;
}
开发者ID:0xmono,项目名称:miranda-ng,代码行数:14,代码来源:skype_menus.cpp


示例2: while

void Router::doClose(Connection *conn, RouterMsg *pMsg)
{
	GatewayInfo *pInfo = (GatewayInfo*)conn->getData();
	int pos = 0;
	while(pos + SID_LENGTH <= pMsg->slen){
		std::string sid(pMsg->data + pos, SID_LENGTH);
		
		LOG("close connection, sid=%s", sid.c_str());
		allSessions.erase(sid);
		pInfo->sessions.erase(sid);
		
		pos+= SID_LENGTH;
	}
}
开发者ID:Maxsl,项目名称:fooking,代码行数:14,代码来源:Router.cpp


示例3: ul

// session 可读
void TcpListener::event_readable(TcpSession::TcpSessionWptr session)
{
	auto sptr = std::move(session.lock());
	if (!sptr)
	{
		return;
	}
	std::uint32_t sid = sptr->sid();

	// 添加到事件列表
	std::unique_lock<std::mutex> ul(m_mtx_ev);
	m_events.push_back(std::bind(&TcpListener::fun_session_readable, this, sid));
	ul.unlock();
}
开发者ID:qianzhanwang,项目名称:networkwrappar,代码行数:15,代码来源:TcpListener.cpp


示例4: sid

MCONTACT CSkypeProto::AddContact(CContact::Ref contact, bool isTemporary)
{
	ptrW sid(::mir_utf8decodeW(contact->GetSid()));

	CContact::AVAILABILITY availability;
	contact->GetPropAvailability(availability);

	MCONTACT hContact = this->GetContactBySid(sid);
	if ( !hContact)
	{
		hContact = (MCONTACT)::CallService(MS_DB_CONTACT_ADD, 0, 0);
		::CallService(MS_PROTO_ADDTOCONTACT, hContact, (LPARAM)this->m_szModuleName);

		ptrW nick(::mir_utf8decodeW(contact->GetNick()));

		switch(availability) {
		case CContact::SKYPEOUT:
			this->setByte(hContact, "IsSkypeOut", 1);
			break;

		case CContact::PENDINGAUTH:
			::db_set_b(hContact, "CList", "NotOnList", 1);
			break;

		case CContact::BLOCKED:
		case CContact::BLOCKED_SKYPEOUT:
			::db_set_b(hContact, "CList", "Hidden", 1);
			break;

		default:
			this->delSetting(hContact, "IsSkypeOut");
			::db_unset(hContact, "CList", "Hidden");
			::db_unset(hContact, "CList", "NotOnList");
		}

		this->setTString(hContact, SKYPE_SETTINGS_SID, sid);
		this->setTString(hContact, "Nick", nick);

		DBVARIANT dbv;
		if ( !this->getTString(SKYPE_SETTINGS_DEF_GROUP, &dbv))
		{
			::db_set_ts(hContact, "CList", "Group", dbv.ptszVal);
			::db_free(&dbv);
		}
	}

	return hContact;
}
开发者ID:0xmono,项目名称:miranda-ng,代码行数:48,代码来源:skype_contacts.cpp


示例5: assert

void PmpPimProtocol::onCreateProfile(PMPFrame * pFrame)
{
    assert(pFrame);
    assert(mEventFactory);

    std::string str = bufferToString(pFrame->data,true);
    unsigned int pos = stringInBufSize(str);
    iviLink::Profile::Uid profileUid(str);
    str = bufferToString(pFrame->data + pos,true);
    pos += stringInBufSize(str);
    iviLink::Profile::IUid piuid(str);
    str = bufferToString(pFrame->data + pos,true);
    iviLink::Service::Uid sid(str);

    mEventFactory->pimProtocolCreateProfile(profileUid, piuid, sid);
}
开发者ID:Luxoft,项目名称:iviLink,代码行数:16,代码来源:PmpPimProtocol.cpp


示例6: while

void Worker::doKick(RouterMsg *pMsg)
{
	int pos = 0;
	while(pos + SID_LENGTH <= pMsg->slen)
	{
		std::string sid(pMsg->data + pos, SID_LENGTH);
		LOG("kick user, sid=%s", sid.c_str());
		ClientList::const_iterator it = arrClients.find(sid);
		if(it != arrClients.end()){
			Connection *pClient = it->second;
			pClient->close();
		}
		
		pos+= SID_LENGTH;
	}
}
开发者ID:luozy,项目名称:fooking,代码行数:16,代码来源:Worker.cpp


示例7: availDevices

// Create a new sid emulation.
unsigned int InnovBuilder::create(unsigned int sids)
{
    m_status = true;

    // Check available devices
    unsigned int count = availDevices();
    if (count == 0)
    {
        m_errorBuffer = "Innovation SSI-2001 ERROR: No devices found";
        goto InnovBuilder_create_error;
    }

    if (count < sids)
        sids = count;

    for (count = 0; count < sids; count++)
    {
        try
        {
            std::auto_ptr<Innov> sid(new Innov(this));

            // SID init failed?
            if (!sid->getStatus())
            {
                m_errorBuffer = sid->error();
                goto InnovBuilder_create_error;
            }
            sidobjs.insert(sid.release());
        }
        // Memory alloc failed?
        catch (std::bad_alloc const &)
        {
            m_errorBuffer.assign(name()).append(" ERROR: Unable to create Innov object");
            goto InnovBuilder_create_error;
        }


    }
    return count;

InnovBuilder_create_error:
    m_status = false;
    return count;
}
开发者ID:bristlehog,项目名称:libsidplayfp-innov,代码行数:45,代码来源:innov-builder.cpp


示例8: bufferToString

      void CPmpPimClbCtrl::onProfileDied(PMPFrame * pFrame)
      {
         std::string str = bufferToString(pFrame->data,true);
         unsigned int pos = stringInBufSize(str);
         iviLink::Profile::IUid piuid(str);
         str = bufferToString(pFrame->data + pos,true);
         iviLink::Service::Uid sid(str);

         mpPimClb->onProfileDied(piuid,sid);

         PMPFrame pResp;
         pResp.size = sizeof(PMPFrame);
         pResp.frameType = PMP_FRAME_TYPE_RESPONSE;
         pResp.id = pFrame->id;
         pResp.client = pFrame->client;
         pResp.reqType = pFrame->reqType;

         mpProtocol->makeResponse(pResp);
      }
开发者ID:babenkoav78,项目名称:iviLink,代码行数:19,代码来源:CPmpPimClbCtrl.cpp


示例9: readFixedLength

pBuffer SourceBase::
        readFixedLength( const Interval& I )
{
    TIME_SOURCEBASE TaskTimer tt("%s.%s %s",
                  vartype(*this).c_str(), __FUNCTION__ ,
                  I.toString().c_str() );

    // Try a simple read
    pBuffer p = readChecked( I );
    if (I == p->getInterval())
        return p;

    // Didn't get exact result, prepare new Buffer
    pBuffer r( new Buffer(I, p->sample_rate(), p->number_of_channels ()) );

    for (int c=0; c<r->number_of_channels (); ++c)
    {
    #ifndef USE_CUDA
        // Allocate cpu memory and prevent calling an unnecessary clear by flagging the store as up-to-date
        CpuMemoryStorage::WriteAll<3>( r->getChannel (c)->waveform_data() );
    #else
        if (p->getChannel (c)->waveform_data()->HasValidContent<CudaGlobalStorage>())
            CudaGlobalStorage::WriteAll<3>( r->getChannel (c)->waveform_data() );
        else
            CpuMemoryStorage::WriteAll<3>( r->getChannel (c)->waveform_data() );
    #endif
    }

    Intervals sid(I);

    while (sid)
    {
        if (!p)
            p = readChecked( sid.fetchFirstInterval() );

        sid -= p->getInterval();
        TIME_SOURCEBASE_LINE((*r) |= *p); // Fill buffer
        p.reset();
    }

    return r;
}
开发者ID:aveminus,项目名称:freq,代码行数:42,代码来源:source.cpp


示例10: sid

bool CHalfLife2::GetServerSteam3Id(char *pszOut, size_t len) const
{
	CSteamID sid(GetServerSteamId64());

	switch (sid.GetEAccountType())
	{
	case k_EAccountTypeAnonGameServer:
		ke::SafeSprintf(pszOut, len, "[A:%u:%u:%u]", sid.GetEUniverse(), sid.GetAccountID(), sid.GetUnAccountInstance());
		break;
	case k_EAccountTypeGameServer:
		ke::SafeSprintf(pszOut, len, "[G:%u:%u]", sid.GetEUniverse(), sid.GetAccountID());
		break;
	case k_EAccountTypeInvalid:
		ke::SafeSprintf(pszOut, len, "[I:%u:%u]", sid.GetEUniverse(), sid.GetAccountID());
		break;
	default:
		return false;
	}

	return true;
}
开发者ID:404UserNotFound,项目名称:sourcemod,代码行数:21,代码来源:HalfLife2.cpp


示例11: lock

void GroupListModule_Impl::_groupUnreadCntResponse(CImPdu* pdu)
{
	CImPduClientGroupUnreadMsgCntResponse* pduOfflineMsgCnt = (CImPduClientGroupUnreadMsgCntResponse*)pdu;
	client_group_unread_cnt_t* pList = pduOfflineMsgCnt->GetGroupUnreadList();
	for (UInt32 i = 0; i < pduOfflineMsgCnt->GetGroupUnreadCnt(); ++i)
	{
		client_group_unread_cnt_t pInfo = pList[i];
		{
			util::TTAutoLock lock(&m_lock);
			std::string sid(pInfo.group_id_url, pInfo.group_id_len);
			m_vecOfflineMsgGroup.push_back(sid);
			logic::GetLogic()->pushBackOperationWithLambda(
				[=]()
			{
				CImPduClientGroupUnreadMsgRequest pduData(sid.c_str());
				logic::getTcpClientModule()->sendPacket(&pduData);
			}
			);
		}
	}
}
开发者ID:3rdexp,项目名称:TTWinClient,代码行数:21,代码来源:GroupListModule_Impl.cpp


示例12: sid

const char *ReSIDBuilder::credits ()
{
    m_status = true;

    // Available devices
    if (sidobjs.size ())
    {
        ReSID *sid = (ReSID *) sidobjs[0];
        return sid->credits ();
    }

    {   // Create an emulation to obtain credits
        ReSID sid(this);
        if (!sid)
		{
            m_status = false;
            strcpy (m_errorBuffer, sid.error ());
            return 0;
        }
        return sid.credits ();
    }
}
开发者ID:Jordanio,项目名称:SidplaySharp,代码行数:22,代码来源:resid-builder.cpp


示例13: assert

void
vec4_gs_visitor::set_stream_control_data_bits(unsigned stream_id)
{
   /* control_data_bits |= stream_id << ((2 * (vertex_count - 1)) % 32) */

   /* Note: we are calling this *before* increasing vertex_count, so
    * this->vertex_count == vertex_count - 1 in the formula above.
    */

   /* Stream mode uses 2 bits per vertex */
   assert(c->control_data_bits_per_vertex == 2);

   /* Must be a valid stream */
   assert(stream_id >= 0 && stream_id < MAX_VERTEX_STREAMS);

   /* Control data bits are initialized to 0 so we don't have to set any
    * bits when sending vertices to stream 0.
    */
   if (stream_id == 0)
      return;

   /* reg::sid = stream_id */
   src_reg sid(this, glsl_type::uint_type);
   emit(MOV(dst_reg(sid), stream_id));

   /* reg:shift_count = 2 * (vertex_count - 1) */
   src_reg shift_count(this, glsl_type::uint_type);
   emit(SHL(dst_reg(shift_count), this->vertex_count, 1u));

   /* Note: we're relying on the fact that the GEN SHL instruction only pays
    * attention to the lower 5 bits of its second source argument, so on this
    * architecture, stream_id << 2 * (vertex_count - 1) is equivalent to
    * stream_id << ((2 * (vertex_count - 1)) % 32).
    */
   src_reg mask(this, glsl_type::uint_type);
   emit(SHL(dst_reg(mask), sid, shift_count));
   emit(OR(dst_reg(this->control_data_bits), this->control_data_bits, mask));
}
开发者ID:TechnoMancer,项目名称:mesa,代码行数:38,代码来源:brw_vec4_gs_visitor.cpp


示例14: ensure_equals

  void tester::test<14>()
  {
    BankSelection mixed;
    mixed.MatchOnly(mixed_list);
    ensure_equals("Has 2 wildcards", mixed.fWildCards.size(), 2u);
    ensure_equals("Has 8 exact matches", mixed.fMatches.size(), 8u);
    
    std::string msg;
    msg = "Should not match ";
    SourceID sid(ID::kScVe,ID::kNotApplicable,"general","default");
    ensure(msg + sid.str(), !mixed.Includes(sid));
    
    sid = SourceID(ID::kMuSc,ID::kNotApplicable,"wrong","default");
    ensure(msg + sid.str(), !mixed.Includes(sid));

    
    msg = "Should match ";
    sid = SourceID(ID::kMuSc,ID::kNotApplicable,"general","default");
    ensure(msg + sid.str(), mixed.Includes(sid));

    sid = SourceID(ID::kSiR1_4, ID::kFast, "general", "default");
    ensure(msg + sid.str(), mixed.Includes(sid));
  }
开发者ID:alcap-org,项目名称:AlcapDAQ,代码行数:23,代码来源:BankSelection_test.cpp


示例15: sid

void randomizer_base::setupIOMappings( )
{
    int ninput_streams = 0;
    int noutput_streams = 0;
    std::vector<std::string>::iterator pname;
    std::string sid("");
    int inMode=RealMode;

    if ( !validGRBlock() ) return;
    ninput_streams  = gr_sptr->get_max_input_streams();
    gr_io_signature_sptr g_isig = gr_sptr->input_signature();

    noutput_streams = gr_sptr->get_max_output_streams();
    gr_io_signature_sptr g_osig = gr_sptr->output_signature();

    LOG_DEBUG( randomizer_base, "GNUHAWK IO MAPPINGS IN/OUT " << ninput_streams << "/" << noutput_streams );

    //
    // Someone reset the GR Block so we need to clean up old mappings if they exists
    // we need to reset the io signatures and check the vlens
    //
    if ( _istreams.size() > 0 || _ostreams.size() > 0 ) {

        LOG_DEBUG( randomizer_base, "RESET INPUT SIGNATURE SIZE:" << _istreams.size() );
        IStreamList::iterator istream;
        for ( int idx=0 ; istream != _istreams.end(); idx++, istream++ ) {
            // re-add existing stream definitons
            LOG_DEBUG(  randomizer_base, "ADD READ INDEX TO GNU RADIO BLOCK");
            if ( ninput_streams == -1 ) gr_sptr->add_read_index();

            // setup io signature
            istream->associate( gr_sptr );
        }

        LOG_DEBUG( randomizer_base, "RESET OUTPUT SIGNATURE SIZE:" << _ostreams.size() );
        OStreamList::iterator ostream;
        for ( int idx=0 ; ostream != _ostreams.end(); idx++, ostream++ ) {
            // need to evaluate new settings...???
            ostream->associate( gr_sptr );
        }

        return;
    }


   //
   // Setup mapping of RH port to GNU RADIO Block input streams
   // For version 1,  we are ignoring the GNU Radio input stream -1 case that allows multiple data 
   // streams over a single connection.  We are mapping a single RH Port to a single GNU Radio stream.
   // Stream Identifiers will  be pass along as they are received
   //
    LOG_TRACE( randomizer_base, "setupIOMappings INPUT PORTS: " << inPorts.size() );
    pname = inputPortOrder.begin();
    for( int i=0; pname != inputPortOrder.end(); pname++ ) {

        // grab ports based on their order in the scd.xml file
        RH_ProvidesPortMap::iterator p_in = inPorts.find(*pname);
        if ( p_in != inPorts.end() ) {
            bulkio::InOctetPort *port = dynamic_cast< bulkio::InOctetPort * >(p_in->second);
            int mode = inMode;
            sid = "";

            // need to add read index to GNU Radio Block for processing streams when max_input == -1
            if ( ninput_streams == -1 ) gr_sptr->add_read_index();

            // check if we received SRI during setup
            BULKIO::StreamSRISequence_var sris = port->activeSRIs();
            if (  sris->length() > 0 ) {
                BULKIO::StreamSRI sri = sris[sris->length()-1];
                mode = sri.mode;
            }
            std::vector<int> in;
            io_mapping.push_back( in );
            _istreams.push_back( gr_istream< bulkio::InOctetPort > ( port, gr_sptr, i, mode, sid ));
            LOG_DEBUG( randomizer_base, "ADDING INPUT MAP IDX:" << i << " SID:" << sid );
            // increment port counter
            i++;
        }
    } 

    //
    // Setup mapping of RH port to GNU RADIO Block input streams
    // For version 1,  we are ignoring the GNU Radio output stream -1 case that allows multiple data 
    // streams over a single connection.  We are mapping a single RH Port to a single GNU Radio stream.
    //
    LOG_TRACE( randomizer_base, "setupIOMappings OutputPorts: " << outPorts.size() );
    pname = outputPortOrder.begin();
    for( int i=0; pname != outputPortOrder.end(); pname++ ) {

        // grab ports based on their order in the scd.xml file
        RH_UsesPortMap::iterator p_out = outPorts.find(*pname);
        if ( p_out != outPorts.end() ) {
            bulkio::OutOctetPort *port = dynamic_cast< bulkio::OutOctetPort * >(p_out->second);
            int idx = -1;
            BULKIO::StreamSRI sri = createOutputSRI( i, idx );
            if (idx == -1) idx = i;
            if(idx < (int)io_mapping.size()) io_mapping[idx].push_back(i);
            int mode = sri.mode;
            sid = sri.streamID;
            _ostreams.push_back( gr_ostream< bulkio::OutOctetPort > ( port, gr_sptr, i, mode, sid ));
//.........这里部分代码省略.........
开发者ID:RedhawkSDR,项目名称:integration-gnuhawk,代码行数:101,代码来源:randomizer_base.cpp


示例16: switch

INT_PTR CALLBACK CSkypeProto::SkypeMainOptionsProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	CSkypeProto *proto = (CSkypeProto *)::GetWindowLongPtr(hwnd, GWLP_USERDATA);

	switch (message)
	{
	case WM_INITDIALOG:
		{
			::TranslateDialogDefault(hwnd);

			proto = (CSkypeProto *)lParam;
			::SetWindowLongPtr(hwnd, GWLP_USERDATA, lParam);
			{
				ptrW sid( ::db_get_wsa(NULL, proto->m_szModuleName, SKYPE_SETTINGS_SID));
				SetDlgItemText(hwnd, IDC_SL, sid);
			}
			{
				ptrA pwd( ::db_get_sa(NULL, proto->m_szModuleName, SKYPE_SETTINGS_PASSWORD));
				SetDlgItemTextA(hwnd, IDC_PW, pwd);
			}
			{
				int port = rand() % 10000 + 10000;
				SetDlgItemInt(hwnd, IDC_PORT, ::db_get_w(NULL, proto->m_szModuleName, "Port", port), FALSE);
				SendMessage(GetDlgItem(hwnd, IDC_PORT), EM_SETLIMITTEXT, 5, 0);
			}

			CheckDlgButton(hwnd, IDC_USE_ALT_PORTS, ::db_get_b(NULL, proto->m_szModuleName, "UseAlternativePorts", 1));
			
			if (proto->IsOnline())
			{
				SendMessage(GetDlgItem(hwnd, IDC_SL), EM_SETREADONLY, 1, 0);
				SendMessage(GetDlgItem(hwnd, IDC_PW), EM_SETREADONLY, 1, 0);
				SendMessage(GetDlgItem(hwnd, IDC_PORT), EM_SETREADONLY, 1, 0);
				EnableWindow(GetDlgItem(hwnd, IDC_USE_ALT_PORTS), FALSE);
				EnableWindow(GetDlgItem(hwnd, IDC_REGISTER), FALSE);
				EnableWindow(GetDlgItem(hwnd, IDC_CHANGE_PWD), TRUE);
				EnableWindow(GetDlgItem(hwnd, IDC_GROUP), FALSE);
			}
			else if (::db_get_w(NULL, proto->m_szModuleName, "Status", ID_STATUS_OFFLINE) > ID_STATUS_OFFLINE)
			{
				EnableWindow(GetDlgItem(hwnd, IDC_REGISTER), FALSE);
			}

			SendDlgItemMessage(hwnd, IDC_GROUP, EM_LIMITTEXT, SKYPE_GROUP_NAME_LIMIT, 0);

			ptrW defgroup( db_get_wsa(NULL, proto->m_szModuleName, SKYPE_SETTINGS_DEF_GROUP));
			SetDlgItemText(hwnd, IDC_GROUP, defgroup);
		}
		return TRUE;

	case WM_COMMAND:
		{
			switch(LOWORD(wParam))
			{
			case IDC_SL:
				{
					if ((HIWORD(wParam) != EN_CHANGE || (HWND)lParam != GetFocus())) return 0;

					if (!proto->IsOnline() && ::db_get_w(NULL, proto->m_szModuleName, "Status", ID_STATUS_OFFLINE) <= ID_STATUS_OFFLINE)
					{
						wchar_t sid[128];
						GetDlgItemText(hwnd, IDC_SL, sid, SIZEOF(sid));
						EnableWindow(GetDlgItem(hwnd, IDC_REGISTER), ::wcslen(sid) != 0);
					}
					SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
				}
				break;

			case IDC_PW:
				{
					if ((HIWORD(wParam) != EN_CHANGE || (HWND)lParam != GetFocus())) return 0;
					if (proto->IsOnline())
					{
						char pwd[128];
						GetDlgItemTextA(hwnd, IDC_SL, pwd, SIZEOF(pwd));
						EnableWindow(GetDlgItem(hwnd, IDC_CHANGE_PWD), ::strlen(pwd) != 0);
					}
					SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
				}
				break;

			case IDC_GROUP:
				{
					if ((HIWORD(wParam) != EN_CHANGE || (HWND)lParam != GetFocus()))
						return 0;
					SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
				}
				break;

			case IDC_PORT:
				{
					if ((HIWORD(wParam) != EN_CHANGE || (HWND)lParam != GetFocus()))
						return 0;
					SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
				}
				break;

			case IDC_USE_ALT_PORTS:
				SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
				break;
//.........这里部分代码省略.........
开发者ID:MrtsComputers,项目名称:miranda-ng,代码行数:101,代码来源:skype_dialogs.cpp


示例17: BCESaddEphemerisTest

void xRinexEphemerisStore :: BCESaddEphemerisTest (void)
{

	ofstream DumpData;
	DumpData.open ("Logs/addEphemerisTest.txt");

	gpstk::GPSEphemerisStore Blank;
     //cout << " On construction, Blank.getInitialTime: " << Blank.getInitialTime() << endl;
     //cout << " On construction, Blank.getFinalTime:   " << Blank.getFinalTime() << endl;

	gpstk::Rinex3EphemerisStore Store;
	Store.loadFile("TestRinex06.031");

        std::list<gpstk::Rinex3NavData> R3NList;
        gpstk::GPSEphemerisStore GStore;
        std::list<gpstk::Rinex3NavData>::const_iterator it;
        Store.addToList(R3NList);
        for (it = R3NList.begin(); it != R3NList.end(); ++it)
          GStore.addEphemeris(gpstk::EngEphemeris(*it));

	short PRN = 1;
        gpstk::SatID sid(PRN,gpstk::SatID::systemGPS);

	gpstk::CivilTime Time(2006,1,31,11,45,0,2);
	gpstk::CivilTime TimeB(2006,1,31,9,59,44,2);
        gpstk::CivilTime TimeE(2006,1,31,13,59,44,2);

        const gpstk::CommonTime ComTime = (gpstk::CommonTime)Time;
        const gpstk::CommonTime ComTimeB = (gpstk::CommonTime)TimeB;
        const gpstk::CommonTime ComTimeE = (gpstk::CommonTime)TimeE;

	const gpstk::EngEphemeris eph = GStore.findEphemeris(sid,ComTime);

     //cout << " ComTime: " << ComTime << " ComTimeB: " << ComTimeB << " ComTimeE: " << ComTimeE << endl;
     //cout << " eph follows: " << endl;
     //cout << eph << endl;

	try
	{
		CPPUNIT_ASSERT_NO_THROW(Blank.addEphemeris(eph));
     //cout << " After assert_no_throw: " << endl;
     //cout << " Blank.getInitialTime: " << Blank.getInitialTime() << endl;
     //cout << " Blank.getFinalTime:   " << Blank.getFinalTime() << endl;

                Blank.clear();
     //cout << " After clear: " << endl;
     //cout << " Blank.getInitialTime: " << Blank.getInitialTime() << endl;
     //cout << " Blank.getFinalTime:   " << Blank.getFinalTime() << endl;

		Blank.addEphemeris(eph);
     //cout << " After addEphemeris(eph): " << endl;
     //cout << " Blank.getInitialTime: " << Blank.getInitialTime() << endl;
     //cout << " Blank.getFinalTime:   " << Blank.getFinalTime() << endl;

		CPPUNIT_ASSERT_EQUAL(ComTimeB,Blank.getInitialTime());
		CPPUNIT_ASSERT_EQUAL(ComTimeE,Blank.getFinalTime());

		Blank.dump(DumpData,1);
	}
	catch (gpstk::Exception& e)
	{
		cout << e;
	}
	CPPUNIT_ASSERT(fileEqualTest((char*)"Logs/addEphemerisTest.txt",(char*)"Checks/addEphemerisTest.chk"));
}
开发者ID:idaohang,项目名称:GPSTk,代码行数:65,代码来源:xRinexEphemerisStore.cpp


示例18: CHECK

common::ErrnoError IStream::sendFrame(const common::http2::frame_base& frame) {
  CHECK(sid() == frame.stream_id());
  common::buffer_t raw = frame.raw_data();
  return sendData(raw);
}
开发者ID:mdvx,项目名称:siteonyourdevice,代码行数:5,代码来源:http_streams.cpp


示例19: do_update_service

	//TODO: Test-Me!!
	private: void do_update_service()
	{
		DCS_DEBUG_TRACE_L(3, "(" << this << ") BEGIN Do-Update-Service (Clock: " << this->node().network().engine().simulated_time() << ")");//XXX

		// Check if there is at least one busy server.
		if (num_busy_ > 0)
		{
			typedef typename server_container::const_iterator iterator;

			real_type new_share(this->share());
			real_type new_multiplier(this->capacity_multiplier());

			// Check if we really need to update currently running customers
			if (::dcs::math::float_traits<real_type>::approximately_equal(old_share_, new_share)
				&& ::dcs::math::float_traits<real_type>::approximately_equal(old_multiplier_, new_multiplier))
			{
				// Share is not changed -> avoid to update customers and reschedule their end-of-service events

				DCS_DEBUG_TRACE_L(3, "(" << this << ") Share/Multiplier not changed: " << old_share_ << " vs. " << new_share << " / " << old_multiplier_ << " vs. " << new_multiplier);

				return;
			}

			real_type cur_time(this->node().network().engine().simulated_time());
			iterator end_it(servers_.end());
			for (iterator it = servers_.begin(); it != end_it; ++it)
			{
				uint_type sid(it->first);
				customer_pointer ptr_customer(it->second);

				// paranoid-check: null
				DCS_DEBUG_ASSERT( ptr_customer );

				DCS_DEBUG_TRACE_L(3, "(" << this << ") Running Customer ID: " << ptr_customer->id());

				runtime_info_type& rt_info(this->info(ptr_customer));

				// paranoid-check: paranoid check
				DCS_DEBUG_ASSERT( rt_info.server_id() == sid );

				DCS_DEBUG_TRACE_L(3, "Updating Customer: " << rt_info.get_customer() << " - Service demand: " << rt_info.service_demand() << " - Multiplier: " << this->capacity_multiplier() << " - old share: " << rt_info.share() << " - old runtime: " << rt_info.runtime() << " - old completed work: " << rt_info.completed_work() << " - old residual-work: " << rt_info.residual_work() << " (Clock: " << this->node().network().engine().simulated_time() << ")");//XXX

				// Increment the accumulated work done by this customer to date...
				rt_info.accumulate_work(cur_time);
				// ... Update the capacity multiplier,...
				rt_info.capacity_multiplier(new_multiplier);
				// ... Update the share,...
				rt_info.share(new_share);
				// ... Compute the new residual work
				real_type new_residual_time(rt_info.residual_work()/new_multiplier);
				// ... And reschedule the end-of-service
				this->node().reschedule_service(*ptr_customer, new_residual_time);

				DCS_DEBUG_TRACE_L(3, "Updated Customer: " << rt_info.get_customer() << " - Service demand: " << rt_info.service_demand() << " - Multiplier: " << this->capacity_multiplier() << " - new share: " << rt_info.share() << " - new runtime: " << rt_info.runtime() << " - new completed work: " << rt_info.completed_work() << " - new residual-work: " << rt_info.residual_work() << " (Clock: " << this->node().network().engine().simulated_time() << ")");//XXX
			}

			old_share_ = new_share;
			old_multiplier_ = new_multiplier;
		}

		DCS_DEBUG_TRACE_L(3, "(" << this << ") END Do-Update-Service (Clock: " << this->node().network().engine().simulated_time() << ")");//XXX
	}
开发者ID:dailypips,项目名称:dcsxx-des,代码行数:63,代码来源:load_independent_service_strategy.hpp


示例20: sid

common::ErrnoError IStream::sendCloseFrame() {
  common::http2::frame_hdr hdr = common::http2::frame_rst::create_frame_header(0, sid());
  uint32_t er = be32toh(common::http2::HTTP2_STREAM_CLOSED);
  common::http2::frame_rst rst(hdr, &er);
  return sendFrame(rst);
}
开发者ID:mdvx,项目名称:siteonyourdevice,代码行数:6,代码来源:http_streams.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ sid_copy函数代码示例发布时间:2022-05-30
下一篇:
C++ si_read_unlock函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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