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


C++ CheckValidity函数代码示例

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


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

示例1: LinkNodes

bool CTrackedNodeMgr::LinkNodes( HTRACKEDNODE ChildID, HTRACKEDNODE ParentID )
{
	//make sure the nodes are valid
	if(!CheckValidity(ChildID) || !CheckValidity(ParentID))
		return false;

	ParentID->m_pChild = ChildID;
	return true;
}
开发者ID:emoose,项目名称:lithtech,代码行数:9,代码来源:TrackedNodeMgr.cpp

示例2: memset

int CWavFile::IsCanCombine(CString strPathL, CString strPathR)
{
	BOOL b = FALSE;
	DWORD m_dwDataSizeL = 0;
	DWORD m_dwDataSizeR = 0;

	memset(&m_formatL, 0, sizeof(WAVEFORMATEX));
	memset(&m_formatR, 0, sizeof(WAVEFORMATEX));
	ZeroMemory(&m_mmckinfoParent, sizeof(MMCKINFO));
	ZeroMemory(&m_mmckinfoSubChunk, sizeof(MMCKINFO));
	
	// Check Validity of the first(left channel) file
	m_dwDataSizeL = CheckValidity(m_hWaveFileL, strPathL, m_formatL);
	if(m_dwDataSizeL == -1)
	{
		MyMessageBox(_T("Invalid wave file: ") + strPathL, eERR_ERROR);
		return -1;
	}

	// Check Validity of the second(right channel) file
	m_dwDataSizeR = CheckValidity(m_hWaveFileR, strPathR, m_formatR);
	if(m_dwDataSizeR == -1)
	{
		MyMessageBox(_T("Invalid wave file: ") + strPathR, eERR_ERROR);
		return -1;
	}

	// All of them must be mono wave file
	if(!(m_formatL.nChannels == 1))
	{
		MyMessageBox(_T("Not a mono wave file: ") + strPathL, eERR_ERROR);
		return -1;
	}
	if(!(m_formatR.nChannels == 1))
	{
		MyMessageBox(_T("Not a mono wave file: ") + strPathR, eERR_ERROR);
		return -1;
	}

	// They must have the same bps
	if(!(m_formatL.wBitsPerSample == m_formatR.wBitsPerSample))
	{
		MyMessageBox(_T("They must have the same bps"), eERR_ERROR);
		return -1;
	}

	// They must have the same sps
	if(m_formatL.nSamplesPerSec != m_formatR.nSamplesPerSec)
	{
		MyMessageBox(_T("They must have the same sps"), eERR_ERROR);
		return -1;
	}

	return max(m_dwDataSizeL, m_dwDataSizeR);
}
开发者ID:ningmenglive,项目名称:NineLine,代码行数:55,代码来源:WavFile.cpp

示例3: LinkNodeOrientation

bool CTrackedNodeMgr::LinkNodeOrientation(	HTRACKEDNODE ID,
											HTRACKEDNODE CopyFrom )
{
	//check the params and parent object
	if(!CheckValidity(ID) || !CheckValidity(CopyFrom))
		return false;

	//ok, setup the link pointer
	ID->m_pMimicNode = CopyFrom;

	//success
	return true;
}
开发者ID:emoose,项目名称:lithtech,代码行数:13,代码来源:TrackedNodeMgr.cpp

示例4: xMin

GridDefinition::GridDefinition(const float xRange[2], const float yRange[2], float pRadius, float pSpacing)
	: xMin(xRange[0]), xMax(xRange[1]), yMin(yRange[0]), yMax(yRange[1]), radius(pRadius), spacing(pSpacing), recipSpacing(1.0/spacing)
{
	numX = (xMax - xMin >= MinRange && spacing >= MinSpacing) ? (uint32_t)((xMax - xMin) * recipSpacing) + 1 : 0;
	numY = (yMax - yMin >= MinRange && spacing >= MinSpacing) ? (uint32_t)((yMax - yMin) * recipSpacing) + 1 : 0;
	CheckValidity();
}
开发者ID:chrishamm,项目名称:RepRapFirmware,代码行数:7,代码来源:Grid.cpp

示例5: ParseMessage

/********************************************************************

  Savcor IT Oy/JLM
  Borland TURBO C++ 3.0
  Declaration: Parse received message
  Call: ret=ParseMessage(ReceiveBuffer)
  Input:  char *ReceiveBuffer
  Returns:  char *ret
  01.12.2000 Initial coding  JLM

*********************************************************************/
 void ParseMessage(char *OutMes)
  {
  int i;
  int j=0;
  char token[BUFFER_SIZE];

  strcpy(OutMes,"");
  strcpy(tempbuf,"");

  for (i=1;i<(int)strlen(Message);i++)
    {		

    if (IsAlpha(Message[i]) && ( i < ((int)strlen(Message)-1)))
      token[j++]=Message[i];
    else
      {
       if (j>0)
        {
          token[j]=0;  // end of string
          strcpy(tempbuf,"");				
          CheckValidity(token); 
          if ( (!DispWithoutLabels) && (strlen(tempbuf)>0))
          {
           strcat(OutMes,token);
           strcat(OutMes,"=");
          }
          strcat(OutMes,tempbuf);
					//printf ("OutMes=%s\n",OutMes);
        }
       j=0;
			} // else
    }
  }
开发者ID:MakSim345,项目名称:MS-VC08,代码行数:44,代码来源:monitor.cpp

示例6: IsLookingAtTarget

bool CTrackedNodeMgr::IsLookingAtTarget( HTRACKEDNODE ID)
{
	if(!CheckValidity(ID))
		return false;

	return ID->m_bLookingAtTarget;
}
开发者ID:emoose,项目名称:lithtech,代码行数:7,代码来源:TrackedNodeMgr.cpp

示例7: lock

bool CSettingString::SetValue(const std::string &value)
{
  CSingleLock lock(m_critical);

  if (value == m_value)
    return true;
    
  if (!CheckValidity(value))
    return false;

  std::string oldValue = m_value;
  m_value = value;

  if (!OnSettingChanging(this))
  {
    m_value = oldValue;

    // the setting couldn't be changed because one of the
    // callback handlers failed the OnSettingChanging()
    // callback so we need to let all the callback handlers
    // know that the setting hasn't changed
    OnSettingChanging(this);
    return false;
  }

  m_changed = m_value != m_default;
  OnSettingChanged(this);
  return true;
}
开发者ID:buzzrc,项目名称:xbmc-12,代码行数:29,代码来源:Setting.cpp

示例8: SetTarget

bool CTrackedNodeMgr::SetTarget( HTRACKEDNODE ID, HOBJECT hModel, HMODELNODE hNode, const LTVector& vOffset )
{
	if(!CheckValidity(ID))
		return false;

	//make sure that the model pointed to is not ourself, this can cause infinite
	//recursion
	assert(hModel != ID->m_hModel);

	//make sure that that is actually a valid model
	uint32 nType;
	if(m_pILTBase->Common()->GetObjectType(hModel, &nType) != LT_OK)
		return false;

	if(nType != OT_MODEL)
		return false;

	//make sure we have a valid node
	if(hNode == INVALID_MODEL_NODE)
		return false;

	//setup this target
	ID->m_eTrackMode	= CTrackedNode::TRACK_NODE;
	ID->m_hTrackObject	= hModel;
	ID->m_hTrackNode	= hNode;
	ID->m_vTrackOffset	= vOffset;

	//success
	return true;
}
开发者ID:emoose,项目名称:lithtech,代码行数:30,代码来源:TrackedNodeMgr.cpp

示例9: lock

bool CSettingNumber::SetValue(double value)
{
  CExclusiveLock lock(m_critical);

  if (value == m_value)
    return true;

  if (!CheckValidity(value))
    return false;

  double oldValue = m_value;
  m_value = value;

  if (!OnSettingChanging(this))
  {
    m_value = oldValue;

    // the setting couldn't be changed because one of the
    // callback handlers failed the OnSettingChanging()
    // callback so we need to let all the callback handlers
    // know that the setting hasn't changed
    OnSettingChanging(this);
    return false;
  }

  m_changed = m_value != m_default;
  OnSettingChanged(this);
  return true;
}
开发者ID:alltech,项目名称:xbmc,代码行数:29,代码来源:Setting.cpp

示例10: IsAtDiscomfort

bool CTrackedNodeMgr::IsAtDiscomfort( HTRACKEDNODE ID)
{
	if(!CheckValidity(ID))
		return false;

	return ID->m_bInDiscomfort;
}
开发者ID:emoose,项目名称:lithtech,代码行数:7,代码来源:TrackedNodeMgr.cpp

示例11: IsTracking

bool CTrackedNodeMgr::IsTracking( HTRACKEDNODE ID )
{
	if(!CheckValidity(ID))
		return false;

	return ID->m_bEnabled;
}
开发者ID:emoose,项目名称:lithtech,代码行数:7,代码来源:TrackedNodeMgr.cpp

示例12: IsAtLimit

bool CTrackedNodeMgr::IsAtLimit( HTRACKEDNODE ID )
{
	if(!CheckValidity(ID))
		return false;

	return ID->m_bAtMaxThreshold;
}
开发者ID:emoose,项目名称:lithtech,代码行数:7,代码来源:TrackedNodeMgr.cpp

示例13: CheckValidity

//m_month setter w/ error checking
void cDate::SetMonth(uint8_t month)
{
	if (month <= 12 && month != 0)
	{
		m_month = month;
		CheckValidity();
	}
}
开发者ID:dnulho,项目名称:School,代码行数:9,代码来源:cDate.cpp

示例14: CheckValidity

bool CSettingInt::CheckValidity(const std::string &value) const
{
  int iValue;
  if (!fromString(value, iValue))
    return false;

  return CheckValidity(iValue);
}
开发者ID:buzzrc,项目名称:xbmc-12,代码行数:8,代码来源:Setting.cpp

示例15: SetOrientOnAnim

bool CTrackedNodeMgr::SetOrientOnAnim( HTRACKEDNODE ID, bool bTrackOnAnim )
{
	if(!CheckValidity(ID))
		return false;

	//just set the flag on the node
	ID->m_bOrientFromAnim = bTrackOnAnim;
	return true;
}
开发者ID:emoose,项目名称:lithtech,代码行数:9,代码来源:TrackedNodeMgr.cpp


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