本文整理汇总了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));
}
}
示例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;
}
}
}
示例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;
}
示例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;
}
示例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;
}
示例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));
}
}
示例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));
}
示例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);
}
示例9: GetIntValueOrDefault
/* 获取section段第一个键为key的int值,成功返回获取的值,否则返回默认值 */
void IniFile::GetIntValueOrDefault(const string §ion, const string &key, int *value, int defaultValue)
{
if (GetIntValue(section, key, value) != 0) {
*value = defaultValue;
}
return;
}
示例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); // 保存下分
}
}
示例11: ParamMLoadFile
void CDialogCCD::OnBnClickedReload()
{
//参数初始化
ParamMLoadFile();
MCardParamLoad();
ImageCalcParamLoad();
g_nWorkMode = GetIntValue(PK_WorkMode);
}
示例12: SetThro
void SetThro()
{
//char type = GetUartChar();
uint8_t value;
//if(type=='t')
{
value = GetIntValue();
Thro = value;
}
}
示例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
}
示例14: ParamMLoadFile
CMainFrame::CMainFrame()
{
//参数初始化
ParamMLoadFile();
MCardParamLoad();
ImageCalcParamLoad();
m_bIsLoopWork = FALSE;
m_nLineCount = 0;
m_timeTotal = CTimeSpan(0);
g_nWorkMode = GetIntValue(PK_WorkMode);
}
示例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");
}