當前位置: 首頁>>代碼示例>>C++>>正文


C++ GetIntValue函數代碼示例

本文整理匯總了C++中GetIntValue函數的典型用法代碼示例。如果您正苦於以下問題:C++ GetIntValue函數的具體用法?C++ GetIntValue怎麽用?C++ GetIntValue使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了GetIntValue函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: while

            void Configuration::FillFromConfigAttributes(const char * attributes)
            {
                // Initializing map.
                arguments.clear();

                size_t len = 0;

                // Getting list length. List is terminated by two '\0'.
                while (attributes[len] || attributes[len + 1])
                    ++len;

                ++len;

                ParseAttributeList(attributes, len, '\0', arguments);

                ArgumentMap::const_iterator it = arguments.find(Key::address);
                if (it != arguments.end())
                {
                    // Parsing address.
                    ParseAddress(it->second, endPoint);
                }
                else
                {
                    endPoint.host = GetStringValue(Key::server, DefaultValue::server);
                    endPoint.port = static_cast<uint16_t>(GetIntValue(Key::port, DefaultValue::port));
                }
            }
開發者ID:TimmyTian,項目名稱:ignite,代碼行數:27,代碼來源:configuration.cpp

示例2: switch

bool Var::Equals(Var* rvalue) {
	switch(type) {
		case vtInt: {
			return GetIntValue() == rvalue->GetIntValue();
		}
		case vtFloat: {
			return GetFloatValue() == rvalue->GetFloatValue();
		}
		case vtString: {
			char* lvaluetext = GetStringValue();
			char* rvaluetext = rvalue->GetStringValue();
			bool result = !strcmp(lvaluetext,rvaluetext);
			delete[] lvaluetext;
			delete[] rvaluetext;
			return result;
		}
		case vtFloat3: {
			return float3value == rvalue->float3value;
		}
		case vtObject: {
			return objectvalue == rvalue->objectvalue; // compare pointers...
		}
		default: {
			return false;
		}
	}
}
開發者ID:JohanMes,項目名稱:JohanEngine,代碼行數:27,代碼來源:Variable.cpp

示例3: GetPrivateProfileString

bool  CIniFileProcessor::GetIRSFacilityID(short& iVal) // unique function to retrieve the id from a unique ini file only for use with IRS
{
	CString irsinipath;
	TCHAR foo[64];
	CIniFileProcessor::GetULFullPath(eIRININAME, irsinipath);

	// Get value from the real ini file source
	// We do it this way (always reloading the file content) as it may change externally, and it resides in a different file from the FDMS.ini anyway
	DWORD dw = 
		GetPrivateProfileString(
		m_Entry[eFACILITYID].section,
		m_Entry[eFACILITYID].name,
		m_Entry[eFACILITYID].defIniValue,
		foo,sizeof(foo),irsinipath);

	if (dw == 0)
	{
		return false;
	}

	if (m_Entry[eFACILITYID].iniValue != NULL)
	{
		delete [] m_Entry[eFACILITYID].iniValue;
	}

	m_Entry[eFACILITYID].iniValue = new TCHAR[strlen(foo)+1];
	foo[strlen(foo)] = 0;  // redundant
	strcpy(m_Entry[eFACILITYID].iniValue, foo);

	iVal = (short)GetIntValue(eFACILITYID);

	return true;
}
開發者ID:hnordquist,項目名稱:FDMS,代碼行數:33,代碼來源:IniFileProcessor.cpp

示例4: strlen

//讀取第nParamIndex個參數,該參數為整型
int CScript::GetIntParam(char* strCmd, int nParamIndex)
{
	int nCmdLen = strlen(strCmd);
	int nStartOfParam = __PassCmdName(strCmd, nCmdLen);

	if(nStartOfParam == nCmdLen)
		return DEMO::ERROR_INT_PARAM;

	int nParamNum = 0;
	m_bScanningStr = false;

	for(int j=nStartOfParam+1; j<nCmdLen; j++)
	{
		if(strCmd[j] == '\"')
			m_bScanningStr = !m_bScanningStr;
		//跳過分隔符
		if(__IsDelimiter(strCmd[j]))
			nParamNum++;
		//讀取到數字參數,讀取並轉換為數字
		if(nParamNum == nParamIndex && 
			(strCmd[j] == '-' || (strCmd[j] >= '0' && strCmd[j] <= '9')))
		{
			return GetIntValue(strCmd, nCmdLen, j);
		}
	}
	return DEMO::ERROR_INT_PARAM;
}
開發者ID:xiaohuajiao,項目名稱:Demo,代碼行數:28,代碼來源:CScript.cpp

示例5: BeforeWorkPro

LRESULT CMainFrame::OnRuning(WPARAM wParam, LPARAM lParam)
{
#ifndef _DEBUG
	BeforeWorkPro();
	BeforeWork();
#endif

	if (GetIntValue(PK_PortCtrlMode) != PCM_USE_WEEK)
	{
		Sleep(500);//延時用於打開吸泵	
	}

	vector<TRACK> _vecTrack;
	//1.獲取加工數據
	if(GetData(_vecTrack) == false)
	{
		OnCloseLoop(NULL, NULL);
		Home();
		return 0;
	}

	//2. 把數據丟進控製卡模塊驅動硬件
	Run(_vecTrack);
	return 0;
}
開發者ID:dusong7,項目名稱:NULL,代碼行數:25,代碼來源:MainFrm.cpp

示例6: ParseAttributeList

            void Configuration::FillFromConnectString(const char* str, size_t len)
            {
                // Initializing map.
                arguments.clear();

                // Initializing DSN to empty string.
                arguments[Key::dsn].clear();

                // Ignoring terminating zero byte if present.
                // Some Driver Managers pass zero-terminated connection string
                // while others don't.
                if (len && !str[len - 1])
                    --len;

                ParseAttributeList(str, len, ';', arguments);

                ArgumentMap::const_iterator it = arguments.find(Key::address);
                if (it != arguments.end())
                {
                    // Parsing address.
                    ParseAddress(it->second, endPoint);
                }
                else
                {
                    endPoint.host = GetStringValue(Key::server, DefaultValue::server);
                    endPoint.port = static_cast<uint16_t>(GetIntValue(Key::port, DefaultValue::port));
                }
            }
開發者ID:TimmyTian,項目名稱:ignite,代碼行數:28,代碼來源:configuration.cpp

示例7: OnPushScore

// 上分
void OnPushScore(char Id) {
	struct stUserInfo *pUser = GetUserInfo(Id);
	int Total = GetIntValue(UD_TOTALSCORE+Id);
	
	// 沒開鎖
	if (!(ConstDownKey[Id] & KEY_LOCK)) {
		return;
	}
	
	Total += GetIntValue(UD_PUSHSCORE_RATIO);
	// 總分
	SetIntValue(UD_TOTALSCORE+Id, Total);
	
	// 上分
	SetIntValue(UD_PUSHSCORE+Id, GetIntValue(UD_PUSHSCORE+Id)+GetIntValue(UD_PUSHSCORE_RATIO));
}
開發者ID:wealthlwg,項目名稱:multi-com-main-card-prj,代碼行數:17,代碼來源:BetPadKey.c

示例8: return

float CGUISliderControl::GetProportion(RangeSelector selector /* = RangeSelectorLower */) const
{
  if (m_iType == SPIN_CONTROL_TYPE_FLOAT)
    return (GetFloatValue(selector) - m_fStart) / (m_fEnd - m_fStart);
  else if (m_iType == SPIN_CONTROL_TYPE_INT)
    return (float)(GetIntValue(selector) - m_iStart) / (float)(m_iEnd - m_iStart);
  return 0.01f * GetPercentage(selector);
}
開發者ID:vanMiez,項目名稱:xbmc,代碼行數:8,代碼來源:GUISliderControl.cpp

示例9: GetIntValueOrDefault

/* 獲取section段第一個鍵為key的int值,成功返回獲取的值,否則返回默認值 */
void IniFile::GetIntValueOrDefault(const string &section, const string &key, int *value, int defaultValue)
{
    if (GetIntValue(section, key, value) != 0) {
        *value = defaultValue;
    }

    return;
}
開發者ID:DoubleKing,項目名稱:spell_correct,代碼行數:9,代碼來源:inifile.cpp

示例10: OnPollScore

// 下分
void OnPollScore(char Id) {
	struct stUserInfo *pUser = GetUserInfo(Id);
	int LocalTotal = GetIntValue(UD_TOTALSCORE+Id);
	int Total = LocalTotal - pUser->TotalBetScore;
	// 正在退幣,不能下分
	if (IsPollingCoin(Id)) {
		return;
	}

	// 沒開鎖
	if (!(ConstDownKey[Id] & KEY_LOCK)) {
		return;
	}
	
	// 減總分
	if (Total > GetIntValue(UD_POLLSCORE_RATIO)) {
		Total -= GetIntValue(UD_POLLSCORE_RATIO);
		LocalTotal -= GetIntValue(UD_POLLSCORE_RATIO);
		SetIntValue(UD_TOTALSCORE+Id, LocalTotal);														// 保存總分
		SetIntValue(UD_POLLSCORE+Id, GetIntValue(UD_POLLSCORE+Id)+GetIntValue(UD_POLLSCORE_RATIO));		// 保存下分
	} else {
		LocalTotal -= Total;
		SetIntValue(UD_TOTALSCORE+Id, LocalTotal);								// 保存總分
		SetIntValue(UD_POLLSCORE+Id, GetIntValue(UD_POLLSCORE+Id)+Total);		// 保存下分
	}
}
開發者ID:wealthlwg,項目名稱:multi-com-main-card-prj,代碼行數:27,代碼來源:BetPadKey.c

示例11: ParamMLoadFile

void CDialogCCD::OnBnClickedReload()
{
	//參數初始化
	ParamMLoadFile();
	MCardParamLoad();
	ImageCalcParamLoad();

	g_nWorkMode = GetIntValue(PK_WorkMode);
}
開發者ID:dusong7,項目名稱:NULL,代碼行數:9,代碼來源:DialogCCD.cpp

示例12: SetThro

void SetThro()
{
	//char type = GetUartChar();
	uint8_t value;
	//if(type=='t') 
		{
			value = GetIntValue();
			Thro = value;
	}
}
開發者ID:yanyu130,項目名稱:JRW_4,代碼行數:10,代碼來源:Control.c

示例13: InitUserData

void InitUserData(void) 
{
	char Idx;
	for (Idx = 0; Idx < PLAYER_COUNT; Idx++) {
		ALLBITS |= (1<<Idx);
	}

	if (READINTVALUE(UD_FIRSTRUN_FLAG) == FIRSTRUN_FLAG) {
		ReadUserData();
		if (GetCharValue(UD_START_SAVE)) {
			RecoverPlayerData();
		}
		if (GetCharValue(UD_UNSAVE_SCORE)) {
			SaveBetWinScore();
		}
	} else {
		ClearUserData();
		SetIntValue(UD_FIRSTRUN_FLAG, FIRSTRUN_FLAG);
	}
#ifdef _NO_PRINT
	SetCharValue(UD_IF_PRINT, 0);
#endif

#ifdef _TEST_
#define Debug lite_printf
	//ClearUserData();
	//SetIntValue(UD_FIRSTRUN_FLAG, FIRSTRUN_FLAG);-
	SetCharValue(UD_IF_PRINT, 0);
	//SetCharValue(UD_BETTIME, 5);
	//SetCharValue(UD_EXTRA_CODE_DIFFICULT, 1);	// 外5門設定難度
	//SetIntValue(UD_ROUNDLOSS_BOOM, 1000000);		// 當輪輸爆機
	//SetIntValue(UD_STAGEWIN_BOOM, 20000000);		// 當期max loss
	//SetIntValue(UD_STAGELOSS_BOOM, 300000000);		// 當期max win
//	for (Idx = 0; Idx < UD_MAXCHAR_STATE; Idx++) {
//		Debug("%p = %d/%d\n", UserDataCharArray + Idx, READCHARVALUE(Idx), UserDataCharArray[Idx]);
//	}
//	for (Idx = 0; Idx < UD_MAXSHORT_STATE; Idx++) {
//		Debug("%p = %d/%d\n", UserDataShortArray + Idx, READSHORTVALUE(Idx), UserDataShortArray[Idx]);
//	}
	for (Idx = 0; Idx < UD_MAXINT_STATE; Idx++) {
		Debug("%p = %d/%d\n", UserDataIntArray + Idx, READINTVALUE(Idx), UserDataIntArray[Idx]);
	}
//	for (Idx = 0; Idx < UD_MAXLONGLONG_STATE; Idx++) {
//		Debug("%p = %d/", UserDataLongLongArray + Idx, READLONGLONGVALUE(Idx));
//		Debug("%d\n", UserDataLongLongArray[Idx]);
//	}
Debug("UUID:\n");
	for (Idx = 0; Idx < USB_PLAYER_COUNT; Idx++) {
		Debug("%p:%d/%d\n", UserDataIntArray+UD_INVALID_INT+Idx, GetIntValue(UD_USB_UUID+Idx), READINTVALUE(UD_USB_UUID+Idx));
	}
	
	SetIntValue(UD_USB_UUID + 5, 123456);
	SetIntValue(UD_USB_UUID + 6, 876543210);
#endif
}
開發者ID:wealthlwg,項目名稱:multi-com-main-card-prj,代碼行數:55,代碼來源:UserData.c

示例14: ParamMLoadFile

CMainFrame::CMainFrame()
{
	//參數初始化
	ParamMLoadFile();
	MCardParamLoad();
	ImageCalcParamLoad();
	m_bIsLoopWork = FALSE;
	m_nLineCount = 0;
	m_timeTotal = CTimeSpan(0);
	g_nWorkMode = GetIntValue(PK_WorkMode);
}
開發者ID:dusong7,項目名稱:NULL,代碼行數:11,代碼來源:MainFrm.cpp

示例15: controlExpression

static bool controlExpression(char relOp, expADT expL, expADT expR, environmentADT env){

	valueADT leftV, rightV;

	leftV = Eval(expL, env);
	rightV = Eval(expR, env);

	if(ValueType(leftV) == IntValue && ValueType(rightV) == IntValue ){

		switch(relOp){

		case '<':
		return (GetIntValue(leftV) < GetIntValue(rightV));

		case '>':
			return (GetIntValue(leftV) > GetIntValue(rightV));

		case '=':
			return (GetIntValue(leftV) == GetIntValue(rightV));

		default:
			Error("Reloperator %c is not valid.\n", relOp);
			break;
		}
	}
	else
		Error("\nCompared expressions is not Integers\n");

}
開發者ID:tobiasanhed,項目名稱:DoP-labb-3,代碼行數:29,代碼來源:eval.c


注:本文中的GetIntValue函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。