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


C++ Prepare函数代码示例

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


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

示例1: init

      /* Explicit constructor, taking as input initial receiver
       * coordinates, ephemeris to be used, default observable and
       * whether TGD will be computed or not.
       *
       * Both the tropospheric and ionospheric models will be set to NULL.
       *
       * This constructor is meant to be used when working with GNSS
       * data structures in order to set the basic parameters from the
       * beginning.
       *
       * @param RxCoordinates Initial receiver coordinates.
       * @param dEphemeris    XvtStore<SatID> object to be used by default.
       * @param dObservable   Observable type to be used by default.
       * @param usetgd        Whether TGD will be used by default or not.
       *
       * @sa DataStructures.hpp.
       */
   ModeledPR::ModeledPR( const Position& RxCoordinates,
                         XvtStore<SatID>& dEphemeris,
                         const TypeID& dObservable,
                         bool usetgd )
   {

      init();
      Prepare(RxCoordinates);
      pDefaultIonoModel = NULL;
      pDefaultTropoModel = NULL;
      setDefaultObservable(dObservable);
      setDefaultEphemeris(dEphemeris);
      useTGD = usetgd;

   }  // End of 'ModeledPR::ModeledPR()'
开发者ID:PPNav,项目名称:GPSTk,代码行数:32,代码来源:ModeledPR.cpp

示例2: OnAcceptTimeout

void Proposer :: OnAcceptTimeout()
{
    PLGHead("OK");
    
    if (GetInstanceID() != m_llTimeoutInstanceID)
    {
        PLGErr("TimeoutInstanceID %lu not same to NowInstanceID %lu, skip",
                m_llTimeoutInstanceID, GetInstanceID());
        return;
    }
    
    BP->GetProposerBP()->AcceptTimeout();
    
    Prepare(m_bWasRejectBySomeone);
}
开发者ID:chaozh,项目名称:phxpaxos,代码行数:15,代码来源:proposer.cpp

示例3: main

main ()
{
        freopen ( "p.in" , "r" , stdin );
        freopen ( "p.out" , "w" , stdout );
        
        int     state;
        while ( init () ) {
                state = Prepare ();
                if ( state == 1 ) printf ( "White has a winning path.\n" ); else
                if ( state == 2 ) printf ( "Black has a winning path.\n" ); else
                if ( state == 3 ) printf ( "White can win in one move.\n" ); else
                if ( state == 4 ) printf ( "Black can win in one move.\n" ); else
                printf ( "There is no winning path.\n" );
        }
}
开发者ID:3013216027,项目名称:zoj-solutions-fish_ball,代码行数:15,代码来源:p1255.cpp

示例4: throw

      /* Returns a satTypeValueMap object, adding the new data generated when
       * calling a modeling object.
       *
       * @param time      Epoch.
       * @param gData     Data object holding the data.
       */
   satTypeValueMap& ModeledPR::processModel( const DayTime& time,
                                             satTypeValueMap& gData )
      throw(Exception)
   {

         // First, if the model is not prepared let's take care of it
      if( !getModelPrepared() )
      {
         Prepare(time, gData);
      }

      ModeledReferencePR::processModel(time, gData);

      return gData;

   }   // End of method 'ModeledPR::processModel()'
开发者ID:loongfee,项目名称:ossim-svn,代码行数:22,代码来源:ModeledPR.cpp

示例5: Prepare

bool csPortalContainer::HitBeamOutline (const csVector3& start,
  	const csVector3& end, csVector3& isect, float* pr)
{
  Prepare ();
  size_t i;
  for (i = 0; i < portals.GetSize (); i++)
  {
    csPortal *p = portals[i];
    if (p->IntersectSegment (start, end, isect, pr))
    {
      return true;
    }
  }

  return false;
}
开发者ID:Tank-D,项目名称:Shards,代码行数:16,代码来源:portalcontainer.cpp

示例6: RegisterIcons

void RegisterIcons()
{
	// prepare masks
	int i;

	if (hHeap)
		HeapDestroy(hHeap);
	hHeap = HeapCreate(HEAP_NO_SERIALIZE, 0, 0);

	for (i = 0; i < DEFAULT_KN_FP_MASK_COUNT; i++)
		Prepare(&def_kn_fp_mask[i], true);

	for (i = 0; i < DEFAULT_KN_FP_OVERLAYS_COUNT; i++)
		Prepare(&def_kn_fp_overlays_mask[i], true);

	if (db_get_b(NULL, MODULENAME, "GroupMirandaVersion", 0)) {
		for (i = 0; i < DEFAULT_KN_FP_OVERLAYS2_COUNT; i++)
			Prepare(&def_kn_fp_overlays2_mask[i], true);
	}
	else {
		for (i = 0; i < DEFAULT_KN_FP_OVERLAYS2_NO_VER_COUNT; i++)
			Prepare(&def_kn_fp_overlays2_mask[i], true);
		for (; i < DEFAULT_KN_FP_OVERLAYS2_COUNT; i++)
			Prepare(&def_kn_fp_overlays2_mask[i], false);
	}

	if (db_get_b(NULL, MODULENAME, "GroupOverlaysUnicode", 1)) {
		for (i = 0; i < DEFAULT_KN_FP_OVERLAYS3_COUNT; i++)
			Prepare(&def_kn_fp_overlays3_mask[i], true);
	}
	else {
		for (i = 0; i < DEFAULT_KN_FP_OVERLAYS3_NO_UNICODE_COUNT; i++)
			Prepare(&def_kn_fp_overlays3_mask[i], true);
		for (; i < DEFAULT_KN_FP_OVERLAYS3_COUNT; i++)
			Prepare(&def_kn_fp_overlays3_mask[i], false);
	}

	for (i = 0; i < DEFAULT_KN_FP_OVERLAYS4_COUNT; i++)
		Prepare(&def_kn_fp_overlays4_mask[i], true);
}
开发者ID:kmdtukl,项目名称:miranda-ng,代码行数:40,代码来源:fingerprint.cpp

示例7: SetID

    bool dbRecord::Execute(uint32 uid)
    {
        SetID(uid);
        CS_ASSERT_MSG("Error: wrong number of expected fields", index == count);

        if(!prepared)
            Prepare();

        psStopWatch timer;
        timer.Start();

        CS_ASSERT(count != index);

        csStringArray paramStrings;
        const char *paramValues[index];
        for(unsigned int i = 0; i < index; i++)
        {
            csString value;
            switch(temp[i].type)
            {
                case SQL_TYPE_FLOAT:
                    value.Format("%f", temp[i].fValue);
                    break;
                case SQL_TYPE_INT:
                    value.Format("%i", temp[i].iValue);
                    break;
                case SQL_TYPE_STRING:
                    value = temp[i].sValue;
                    break;
                case SQL_TYPE_NULL:
                    break;
            }
            paramStrings.Push(value);
            paramValues[i] = paramStrings.Get(i);
        }

        PGresult *res = PQexecPrepared(conn, stmt.GetData(), index, paramValues, NULL, NULL,0);
        bool result = (res && PQresultStatus(res) != PGRES_FATAL_ERROR);
        if(result && timer.Stop() > 1000)
        {
            csString status;
            status.Format("SQL query in file %s line %d, has taken %u time to process.\n", file, line, timer.Stop());
            if(logcsv)
                logcsv->Write(CSV_STATUS, status);
        }
        return result;
    }
开发者ID:Mixone-FinallyHere,项目名称:planeshift,代码行数:47,代码来源:dal.cpp

示例8: StmtHldr

 Statement::Statement(Connection &conn, const std::string &stmt)
   : StmtHldr(new StatementHolder(conn))
   , IsOpen(false)
 {
   if (!stmt.empty())
   {
     try
     {
       Prepare(stmt);
     }
     catch (std::exception &)
     {
       delete StmtHldr;
       throw;
     }
   }
 }
开发者ID:Diego160289,项目名称:cross-fw,代码行数:17,代码来源:DBWrap.cpp

示例9: Prepare

void SerializedGameData::MakeSnapshot(GameWorld& gw, EventManager& evMgr)
{
    Prepare(false);

    // Anzahl Objekte reinschreiben
    PushUnsignedInt(GameObject::GetObjCount());

    // Objektmanager serialisieren
    gw.Serialize(*this);
    // EventManager serialisieren
    evMgr.Serialize(*this);
    // Spieler serialisieren
    for(unsigned i = 0; i < GAMECLIENT.GetPlayerCount(); ++i)
        GAMECLIENT.GetPlayer(i).Serialize(*this);

    writtenObjIds.clear();
}
开发者ID:Ribosom,项目名称:s25client,代码行数:17,代码来源:SerializedGameData.cpp

示例10: syncs

void P2PSync<Dtype>::Run(const vector<int>& gpus) {
  vector<shared_ptr<P2PSync<Dtype> > > syncs(gpus.size());
  Prepare(gpus, &syncs);

  LOG(INFO)<< "Starting Optimization";

  for (int i = 1; i < syncs.size(); ++i) {
    syncs[i]->StartInternalThread();
  }

  // Run root solver on current thread
  solver_->Solve();

  for (int i = 1; i < syncs.size(); ++i) {
    syncs[i]->StopInternalThread();
  }
}
开发者ID:fireae,项目名称:caffe,代码行数:17,代码来源:parallel.cpp

示例11: Manacher

void Manacher(char *s,int *len)
{
    int mx=0,id,i;
    Prepare(s);
    memset(len,0,sizeof(len));
    for (i=1; i<slen; i++)
    {
        if (mx>i) len[i]=Min(len[2*id-i],mx-i);
        else len[i]=1;
        while (str[i-len[i]]==str[i+len[i]]) len[i]++;
        if (i+len[i]>mx)
        {
            mx=i+len[i];
            id=i;
        }
    }
}
开发者ID:Leon555,项目名称:ACM-ICPC-Algorithm,代码行数:17,代码来源:poj3974.c

示例12: get

	inline bool get(int target) {
		Prepare(target);
		memset(link, 0, sizeof link);
		for (int i = 1; i <= n; i++) 
			for (int j = 1; j <= m; j++) if (ok(i, j)) {
				cur++;
				Dfs(lab[i][j]);
			}
		for (int i = 1; i <= n; i++) 
			for (int j = 1; j <= m; j++) if (!ok(i,j))
				link[link[lab[i][j]]] = lab[i][j];
		int u = lab[px][py];
		if (!link[u]) return false;
		cur++;
		hash[u] = cur;
		bool ret = !Dfs(link[u], false);
		return ret;
	}
开发者ID:AiHaibara,项目名称:acm-icpc,代码行数:18,代码来源:2437.cpp

示例13: GetKey

void CRemote::PageLogin()
{
	if ( ! Settings.Remote.Username.IsEmpty() &&
		 ! Settings.Remote.Password.IsEmpty() )
	{
		CString strUsername = GetKey( L"username" );
		CString strPassword = GetKey( L"password" );

		if ( strUsername.IsEmpty() )
			strUsername = GetKey( L"name" );
		if ( strPassword.IsEmpty() )
			strPassword = GetKey( L"pass" );

		if ( strUsername == Settings.Remote.Username && ! strPassword.IsEmpty() )
		{
			CSHA pSHA1;
			pSHA1.Add( (LPCTSTR)strPassword, strPassword.GetLength() * sizeof(TCHAR) );
			pSHA1.Finish();
			Hashes::Sha1Hash tmp;
			pSHA1.GetHash( &tmp[ 0 ] );
			tmp.validate();
			strPassword = tmp.toString();

			if ( strPassword == Settings.Remote.Password )
			{
				// Success:
				__int32 nCookie = GetRandomNum( 0i32, _I32_MAX );
				m_pCookies.AddTail( nCookie );
				m_sHeader.Format( L"Set-Cookie: EnvyRemote=%i; path=/remote\r\n", nCookie );
				m_sRedirect.Format( L"/remote/home?%i", GetRandomNum( 0i32, _I32_MAX ) );
				return;
			}
		}
	}

	// Pre-fill or Failure:
	m_nTab = tabNone;
	Prepare();		// Header
	if ( ! GetKey( L"submit" ).IsEmpty() )
		Add( L"failure", L"true" );
	else if ( GetKey( L"username" ) == Settings.Remote.Username )
		Add( L"user_name", Settings.Remote.Username );
	Output( L"login" );
}
开发者ID:GetEnvy,项目名称:Envy,代码行数:44,代码来源:Remote.cpp

示例14: Tracenf

bool CGuildMarkUploader::__LoginState_RecvKeyAgreement()
{
	TPacketKeyAgreement packet;
	if (!Recv(sizeof(packet), &packet))
	{
		return false;
	}

	Tracenf("KEY_AGREEMENT RECV %u", packet.wDataLength);

	TPacketKeyAgreement packetToSend;
	size_t dataLength = TPacketKeyAgreement::MAX_DATA_LEN;
	size_t agreedLength = Prepare(packetToSend.data, &dataLength);
	if (agreedLength == 0)
	{
		// 초기화 실패
		Disconnect();
		return false;
	}
	assert(dataLength <= TPacketKeyAgreement::MAX_DATA_LEN);

	if (Activate(packet.wAgreedLength, packet.data, packet.wDataLength))
	{
		// Key agreement 성공, 응답 전송
		packetToSend.bHeader = HEADER_CG_KEY_AGREEMENT;
		packetToSend.wAgreedLength = (WORD)agreedLength;
		packetToSend.wDataLength = (WORD)dataLength;

		if (!Send(sizeof(packetToSend), &packetToSend))
		{
			Tracen(" CAccountConnector::__AuthState_RecvKeyAgreement - SendKeyAgreement Error");
			return false;
		}
		Tracenf("KEY_AGREEMENT SEND %u", packetToSend.wDataLength);
	}
	else
	{
		// 키 협상 실패
		Disconnect();
		return false;
	}
	return true;
}
开发者ID:drunkwolfs,项目名称:mt2-source,代码行数:43,代码来源:GuildMarkUploader.cpp

示例15: sizeof

void OpenSMOKE_PostProcessor_RateOfProductionAnalysis::ReadFromBinaryFile(BzzLoad &fLoad)
{
	char dummy[Constants::NAME_SIZE];
	fLoad.fileLoad.read((char*) dummy, sizeof(dummy));
	std::string version = dummy;
	if (version != "V20100417")
		ErrorMessage("This version post processing file is not supported: " + version);
	cout << "Version: " << version << endl;

	// Indices of species
	CheckInBinaryFile(fLoad, "INDICES");
	fLoad >> indices;	

	// Reaction rates
	CheckInBinaryFile(fLoad, "REACTIONRATES");
	fLoad >> reactionRates;

	// Preparing data
	ropa = new OpenSMOKE_RateOfProductionAnalysis();
	BzzVector aux_x = post_processor->get_x();
	ropa->Initialize(post_processor->mix, indices);
	ropa->SetNumberOfPoints(aux_x.Size());
	ropa->Run(reactionRates, aux_x);

	// Formation rates
	{
		ChangeDimensions(post_processor->get_x().Size(), NC, &formationRates);
		BzzVector RVector(NC);
		BzzVector C(NC);
		for(int j=1;j<=post_processor->get_x().Size();j++)
		{
			double T    = post_processor->get_T(j);
			double P_Pa = post_processor->get_P_Pa(j);
			double Ctot = post_processor->get_Ctot(j);
			C = post_processor->get_C(j);
			post_processor->mix->ComputeKineticParameters( T, log(T), 1./T, P_Pa);
			post_processor->mix->ComputeFromConcentrations( T, C, Ctot, &RVector);	// [kmol/m3/s]
			formationRates.SetRow(j, RVector);										// [kmol/m3/s]
		}
	}
	Prepare();
}
开发者ID:acuoci,项目名称:OpenSMOKE,代码行数:42,代码来源:OpenSMOKE_PostProcessor_RateOfProductionAnalysis.cpp


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