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

C++ CheckValidity函数代码示例

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

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



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


示例16: SetIgnoreParentAnimation

bool CTrackedNodeMgr::SetIgnoreParentAnimation( HTRACKEDNODE ID, bool bIgnoreParentAnimation )
{
	if(!CheckValidity(ID))
		return false;

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


示例17: NS_ENSURE_ARG_POINTER

nsresult
nsIConstraintValidation::CheckValidity(bool* aValidity)
{
  NS_ENSURE_ARG_POINTER(aValidity);

  *aValidity = CheckValidity();

  return NS_OK;
}
开发者ID:BitVapor,项目名称:Pale-Moon,代码行数:9,代码来源:nsIConstraintValidation.cpp


示例18: SetAutoDisable

bool CTrackedNodeMgr::SetAutoDisable( HTRACKEDNODE ID, bool bAutoDisable )
{
	if(!CheckValidity(ID))
		return false;

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


示例19: SetTargetObject

bool CTrackedNodeMgr::SetTargetObject( HTRACKEDNODE ID, const LTVector& vPosition )
{
	if(!CheckValidity(ID))
		return false;

	//setup this target
	ID->m_eTrackMode	= CTrackedNode::TRACK_OBJSPACEPOS;
	ID->m_vTrackOffset	= vPosition;

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


示例20: Trajectory

Trajectory PlanningProblem::RRT_APF_Solve(const ObstacleSet &ob_set,
                                           Trajectory &prior_plan,
                                           bool stop_when_collid)
{
    Trajectory *temp_trajec = new Trajectory();
    temp_trajec->appendState(initialState);

    for(int step = 1; step <= MAX_APF_STEP_TRY; step++) {
        // check reaching the goal state
        Station current_station = temp_trajec->getLastStation();
        if( (goal.minDistTo(current_station) < agent->radius() * 1) )
        {
            temp_trajec->appendState(goal.goal_point);
            planningResult = true;
            break;
        }

        Vector2D total_force;
        if( !pathHasCollision(current_station, goal.goal_point, ob_set) ) {
//            temp_trajec->appendState(goal.goal_point);
//            planningResult = true;
//            break;
            total_force += GoalAttractiveForce(current_station);
        }

//        else
        {
            Station next_goal = getNextStation(current_station, prior_plan);
            total_force += PathDirectedForce(current_station, prior_plan);
            vector<Vector2D> ob_forces = ObstacleForces(current_station, ob_set);
            Vector2D ob_total_force;
            for(uint i=0; i<ob_forces.size(); i++)  {
                ob_total_force += ob_forces[i];
            }
            if(!pathHasCollision(current_station, next_goal, ob_set)) {
                ob_total_force *= 0.2;
            }
            total_force += ob_total_force;
        }

        Station new_station;
        new_station = agent->step(current_station,
                                  (total_force.normalized()).to3D(),
                                  0.080 /*sec*/);
        temp_trajec->appendState(new_station);
        if(stop_when_collid) {
            if( !CheckValidity(new_station) ) {
                planningResult = false;
                break;
            }
        }
    }
    return *temp_trajec;
}
开发者ID:amiryanj,项目名称:cyrus_ssl,代码行数:54,代码来源:planningproblem.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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