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

C++ Prepare函数代码示例

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

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



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


示例16: Prepare

void Web::Setup(std::string skin) {
	if (skin.empty()) skin = default_skin;
	Models::Generic::Setup c;
	Prepare(c,"[Setup]");
	std::string lock = GetFromConfig<std::string>("setup.lockfile");
	if (Generic::FileSystem::Check(lock).ExistFile()) {
		render(skin,"Setup",c);
		return;
	}
	if(request().request_method()=="POST") {
		c.load(context());
		c.clear();
		Generic::FileSystem::Create(lock).CreateFile();
		std::string schema = GetFromConfig<std::string>("setup.db-schema");
		
		Static::DB::Interact.LoadSchema(schema);
		response().set_redirect_header("/");
	}
	render(skin,"Setup",c);
}
开发者ID:eientei,项目名称:Radiorandom,代码行数:20,代码来源:Setup.cpp


示例17: gauge

HRESULT CChainComparer::Execute()
{
	// if either of the chains is null, nothing to do - everything inserted/deleted - return now
	if (m_pAnchor1 == NULL || m_pAnchor2 == NULL)
		return S_OK;

	CCompareChainsDepthGauge gauge(m_pHost->GetContext());
	m_pHost->SendOccaisionalProgressMessage();
	Prepare();
	DUMP_CHAIN(DBG_START_OF_BINDING, "At start of binding");

	if (m_pHost->DoBothFilesHaveRSIDInfo())
		SequenceIDSensitivePass();

	CompareTheChains();

	DUMP_CHAIN(DBG_END_OF_COMPARE, "At the end of compare chains");
	ProgressMessageWithCancelCheck();
	return S_OK;
}
开发者ID:killbug2004,项目名称:WSProf,代码行数:20,代码来源:ChainComparer.cpp


示例18: Prepare

void SerializedGameData::ReadSnapshot(GameWorld& gw)
{
    Prepare(true);

    em = &gw.GetEvMgr();

    expectedObjectsCount = PopUnsignedInt();
    GameObject::SetObjCount(0);

    gw.Deserialize(*this);
    em->Deserialize(*this);
    for (unsigned i = 0; i < gw.GetPlayerCount(); ++i)
        gw.GetPlayer(i).Deserialize(*this);

    // If this check fails, we did not serialize all objects or there was an async
    RTTR_Assert(expectedObjectsCount == GameObject::GetObjCount());
    RTTR_Assert(expectedObjectsCount == objectsCount + 1); // "Nothing" nodeObj does not get serialized
    em = NULL;
    readObjects.clear();
}
开发者ID:vader1986,项目名称:s25client,代码行数:20,代码来源:SerializedGameData.cpp


示例19: main

int main(int argc, const char * argv[]) {

	if (argc != 3) {
		fprintf(stderr, "use: %s input_file filter_char\n", argv[0]);
		exit(1);
	}

	UtInit();

	Prepare();

	UtCreate(ReaderThread, (UT_ARGUMENT)argv[1]);
	UtCreate(FilterThread, (UT_ARGUMENT)argv[2][0]);
	UtCreate(PrinterThread, (UT_ARGUMENT)0);
	
	UtRun();
	
	UtEnd();
	return 0;
}
开发者ID:sandrapatfer,项目名称:PROMPT11-07-ConcurrentProgramming.sandrapatfer,代码行数:20,代码来源:Test.c


示例20: QString

void GoodThumbSource::generate(base::binary_guard &&guard) {
	if (!guard) {
		return;
	}
	const auto data = _document->data();
	const auto isWallPaper = _document->isWallPaper();
	auto location = _document->location().isEmpty()
		? nullptr
		: std::make_unique<FileLocation>(_document->location());
	if (data.isEmpty() && !location) {
		_empty = true;
		return;
	}
	crl::async([
		=,
		guard = std::move(guard),
		location = std::move(location)
	]() mutable {
		const auto filepath = (location && location->accessEnable())
			? location->name()
			: QString();
		auto result = Prepare(filepath, data, isWallPaper);
		auto bytes = QByteArray();
		if (!result.isNull()) {
			auto buffer = QBuffer(&bytes);
			const auto format = (isWallPaper && result.hasAlphaChannel())
				? "PNG"
				: "JPG";
			result.save(&buffer, format, kGoodThumbQuality);
		}
		if (!filepath.isEmpty()) {
			location->accessDisable();
		}
		const auto bytesSize = bytes.size();
		ready(
			std::move(guard),
			std::move(result),
			bytesSize,
			std::move(bytes));
	});
}
开发者ID:telegramdesktop,项目名称:tdesktop,代码行数:41,代码来源:data_document_good_thumbnail.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ PrepareDC函数代码示例发布时间:2022-05-30
下一篇:
C++ Prefs函数代码示例发布时间: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