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

C++ IsType函数代码示例

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

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



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

示例1: Size_Target_Array

//
// Setting the targets that this grunt will access.
//
BOOL Grunt::Set_Targets( int count, Target_Spec *target_specs )
{
	// Remove previous completion queue if it was created by the Grunt.
	if ( !IsType( type, GenericVIType ) && io_cq )
	{
		delete io_cq;
	}
	io_cq = NULL;

	// If no targets are being set, simply clear the target list.
	if ( !count )
	{
		cout << "   clearing target list." << endl;
		return Size_Target_Array( 0 );
	}

	// Allocate enough targets
	if ( !Size_Target_Array( count, target_specs ) )
		return FALSE;

	worker_performance.target_results.count = count;

	// Create appropriate completion queue object based on targets.
	// If the Grunt will manage VI targets, the targets will provide a
	// pointer to the completion queue to use.
#if defined(IOMTR_SETTING_VI_SUPPORT)
	if ( IsType( type, GenericVIType ) )
	{
		// VI targets must know where the data buffer is and its size before
		// being initialized.
		((TargetVI*)targets[0])->data_buffer = (char*) read_data;
		((TargetVI*)targets[0])->data_buffer_size = access_spec.max_transfer;
		io_cq = &((TargetVI*)targets[0])->vi.vi_cq;
	}
	else
#endif // IOMTR_SETTING_VI_SUPPORT
	{
		// Create completion queue and verify its creation.
		if ( !(io_cq = new CQAIO) )
		{
			cout << "*** Unable to create completion queue while setting "
				<< "targets." << endl;
			return FALSE;
		}
	}

	// Initialize the specific targets.
	for ( int i = 0; i < count; i++ )
	{
		if ( !targets[i]->Initialize( &target_specs[i], io_cq ) )
			return FALSE;
	}

	// Seed the random number generator.  Grunts transferring data over a
	// network will use the same seed to produce the same sequence of random
	// numbers.  This will keep them in synch.
	Srand( target_specs[0].random );

	return Resize_Transaction_Arrays();
}
开发者ID:BackupTheBerlios,项目名称:iometer-svn,代码行数:63,代码来源:IOGrunt.cpp


示例2: ADDTOCALLSTACK

void CItemSpawn::OnTick(bool fExec)
{
	ADDTOCALLSTACK("CitemSpawn:OnTick");

	INT64 iMinutes;

	if ( m_itSpawnChar.m_TimeHiMin <= 0 )
		iMinutes = Calc_GetRandLLVal(30) + 1;
	else
		iMinutes = minimum(m_itSpawnChar.m_TimeHiMin, m_itSpawnChar.m_TimeLoMin) + Calc_GetRandLLVal(abs(m_itSpawnChar.m_TimeHiMin - m_itSpawnChar.m_TimeLoMin));

	if ( iMinutes <= 0 )
		iMinutes = 1;

	if ( !fExec || IsTimerExpired() )
		SetTimeout(iMinutes * 60 * TICK_PER_SEC);	// set time to check again.

	if ( !fExec || m_currentSpawned >= GetAmount() )
		return;

	CResourceDef *pDef = FixDef();
	if ( !pDef )
	{
		RESOURCE_ID_BASE rid = IsType(IT_SPAWN_ITEM) ? m_itSpawnItem.m_ItemID : m_itSpawnChar.m_CharID;
		DEBUG_ERR(("Bad Spawn point uid=0%lx, id=%s\n", (DWORD)GetUID(), g_Cfg.ResourceGetName(rid)));
		return;
	}

	if ( IsType(IT_SPAWN_ITEM) )
		GenerateItem(pDef);
	else
		GenerateChar(pDef);
}
开发者ID:DarkLotus,项目名称:Source,代码行数:33,代码来源:CItemSpawn.cpp


示例3: GetManager

//
// Adding the specified worker to the display.
//
void CWorkerView::AddWorker(Worker * worker)
{
	HTREEITEM hmanager, hworker;
	int icon;

	// Get the handle to the tree view entry of the worker's manager.
	hmanager = GetManager(worker->manager);

	if (IsType(worker->Type(), GenericDiskType))
		icon = WORKER_ICON_DISKWORKER;
	else if (IsType(worker->Type(), GenericServerType))
		icon = WORKER_ICON_NETSERVER;
	else if (IsType(worker->Type(), GenericClientType))
		icon = WORKER_ICON_NETCLIENT;
	else
		icon = WORKER_ICON_MANAGER;

	// Add the worker to the manager in the tree view.
	hworker = m_TWorkers.InsertItem(worker->name, icon, icon, hmanager, TVI_LAST);
	m_TWorkers.SetItemData(hworker, (DWORD_PTR) worker);
	m_TWorkers.RedrawWindow();

	// Update the Assigned Access Specs listbox.
	theApp.pView->m_pPageAccess->ShowAssignedAccess();
}
开发者ID:blusjune,项目名称:.bsrc,代码行数:28,代码来源:WorkerView.cpp


示例4: ManagerCount

//
// Returns TRUE if all of the workers (on all managers) have
// the same access specification list.
//
BOOL ManagerList::AreAccessSpecsIdentical()
{
	int m, w, s, wkr_count, mgr_count, spec_count;
	Worker *compare_worker, *current_worker;
	Manager *mgr;

	// Get the first non-client worker for any manager.
	mgr_count = ManagerCount();
	for (m = 0; m < mgr_count; m++) {
		mgr = GetManager(m);
		wkr_count = mgr->WorkerCount();

		// Find the first non-client worker for this manager.
		for (w = 0; w < wkr_count; w++) {
			compare_worker = mgr->GetWorker(w);

			if (!IsType(compare_worker->Type(), GenericClientType)) {
				spec_count = compare_worker->AccessSpecCount();
				break;
			}
		}

		// See if we found a valid worker for this manager
		if (w < wkr_count)
			break;
	}

	// Did we find a worker to compare against?
	if (m == mgr_count)
		return TRUE;

	// Compare the first worker's Test_Spec to each other worker's Test_Spec.
	// Include the manager with the worker being compared with in our testing.
	for (m; m < mgr_count; m++) {
		mgr = GetManager(m);
		wkr_count = mgr->WorkerCount();

		// Only compare against non-client workers.
		for (w = 0; w < wkr_count; w++) {
			current_worker = mgr->GetWorker(w);

			// Skip network clients.
			if (IsType(current_worker->Type(), GenericClientType))
				continue;

			// If this worker doesn't have the same number of access specs, return FALSE.
			if (current_worker->AccessSpecCount() != spec_count)
				return FALSE;

			// Check to make sure each returned Test_Spec pointer is identical to (and in the
			// same order as) the pointer in the first_worker.
			for (s = 0; s < spec_count; s++) {
				if (current_worker->GetAccessSpec(s) != compare_worker->GetAccessSpec(s))
					return FALSE;
			}
		}
	}

	return TRUE;
}
开发者ID:BackupTheBerlios,项目名称:iometer-svn,代码行数:64,代码来源:ManagerList.cpp


示例5: Item_GetDef

bool CItem::Ship_Plank( bool fOpen )
{
	// IT_SHIP_PLANK to IT_SHIP_SIDE and IT_SHIP_SIDE_LOCKED
	// This item is the ships plank.

	CItemBase * pItemDef = Item_GetDef();
	ITEMID_TYPE idState = (ITEMID_TYPE) RES_GET_INDEX( pItemDef->m_ttShipPlank.m_idState );
	if ( ! idState )
	{
		// Broken ?
		return( false );
	}
	if ( IsType(IT_SHIP_PLANK))
	{
		if ( fOpen )
			return( true );
	}
	else
	{
		DEBUG_CHECK( IsType(IT_SHIP_SIDE) || IsType(IT_SHIP_SIDE_LOCKED));
		if ( ! fOpen )
			return( true );
	}

	SetID( idState );
	Update();
	return( true );
}
开发者ID:GenerationOfWorlds,项目名称:Sphere,代码行数:28,代码来源:CItemMulti.cpp


示例6: return

 bool FundamentalValue::GetAsInteger(int* out_value) const
 {
     if(out_value && IsType(TYPE_INTEGER))
     {
         *out_value = integer_value_;
     }
     return (IsType(TYPE_INTEGER));
 }
开发者ID:abyvaltsev,项目名称:putty-nd3.x,代码行数:8,代码来源:value.cpp


示例7: ADDTOCALLSTACK

CResourceDef * CItemSpawn::FixDef()
{
	ADDTOCALLSTACK("CitemSpawn:FixDef");
	// Get a proper RESOURCE_ID from the id provided.
	// RETURN: true = ok.

	RESOURCE_ID_BASE rid = ( IsType(IT_SPAWN_ITEM) ? m_itSpawnItem.m_ItemID : m_itSpawnChar.m_CharID );

	if ( rid.GetResType() != RES_UNKNOWN )
	{
		return STATIC_CAST <CResourceDef *>(g_Cfg.ResourceGetDef(rid));
	}

	// No type info here !?
	if ( IsType(IT_SPAWN_ITEM))
	{
		ITEMID_TYPE id = static_cast<ITEMID_TYPE>(rid.GetResIndex());
		if ( id < ITEMID_TEMPLATE )
		{
			return( TryItem( id ) );
		}
		else
		{
			// try a template.
			rid = RESOURCE_ID( RES_TEMPLATE, id );
			CResourceDef * pDef = g_Cfg.ResourceGetDef(rid);
			if ( pDef )
			{
				m_itSpawnItem.m_ItemID = rid;
				return( STATIC_CAST <CResourceDef *>( pDef ));
			} //if fails
			return( TryItem( id ) );
		}
	}
	else
	{
		CREID_TYPE id = static_cast<CREID_TYPE>(rid.GetResIndex());
		if ( id < SPAWNTYPE_START )
		{
			return( TryChar( id ));
		}
		else
		{
			// try a spawn group.
			rid = RESOURCE_ID( RES_SPAWN, id );
			CResourceDef * pDef = g_Cfg.ResourceGetDef(rid);
			if ( pDef )
			{
				m_itSpawnChar.m_CharID = rid;
				return( STATIC_CAST <CResourceDef *>( pDef ));
			} //if fails
			return( TryChar( id ));
		}
	}
}
开发者ID:zolter,项目名称:Source,代码行数:55,代码来源:CItemSp.cpp


示例8: GetAssociation

void CMVPeriod::read_body(wistream& s)
{
	CMString str,token,token2;
	str = GetAssociation(L"yearend");
	int yearend = str.length() ? CMTime::Month(str.c_str()) : 12;
	if (IsType(L"trace"))
		traceno = 1;
	else {
		str = GetAssociation(L"trace");
		traceno = str.length() ? _wtoi(str.c_str()) : 0;
	}
	if (IsType(L"alwaysdraw") || IsType(L"monthly")) // LEGACY
		periodstate |= forceEvaluation;
	periodformat = -1;
	array.ResetAndDestroy(1);
	while(!s.eof()) {
		str.read_line(s);
		if (str.is_null() || str[0] == L'*')
			continue;
		if (str(0,wcslen(vardef_end)) == vardef_end)
			break;
		CMTokenizer next(str);
		token = next();
		token2 = next(L"\r\n");
		switch (token.length()) {
			case 1:
			case 2:
				SetExpression(CMTime(2000,_wtoi(token.c_str())),token2.c_str());
				if (periodformat<0) periodformat = CMTime::MM;
				break;
			case 4:
				{
				int yr = _wtoi(token.c_str());
				CMTime t((yearend<12)?(yr-1):yr,yearend%12+1);
				SetExpression(t,token2.c_str());
				if (periodformat<0) periodformat = CMTime::YYYY;
				}
				break;
			case 6:
				if (periodformat<0) periodformat = CMTime::YYYYMM;
			case 8:
				if (periodformat<0) periodformat = CMTime::YYYYMMDD;
			case 10:
				if (periodformat<0) periodformat = CMTime::YYYYMMDDHH;
			case 12:
				if (periodformat<0) periodformat = CMTime::YYYYMMDDHHMM;
			default:
				if (periodformat<0) periodformat = CMTime::YYYYMMDDHHMMSS;
				SetExpression(CMTime(token),token2.c_str());
				break;
		}
	}
	array.Resize(array.Count());
}
开发者ID:caseymcspadden,项目名称:IRPSIM,代码行数:54,代码来源:vperiod.cpp


示例9: DEBUG_CHECK

bool CItemMulti::MultiRealizeRegion()
{
	// Add/move a region for the multi so we know when we are in it.
	// RETURN: ignored.

	DEBUG_CHECK( IsType(IT_MULTI) || IsType(IT_SHIP) );
	ASSERT( IsTopLevel());

	const CItemBaseMulti * pMultiDef = Multi_GetDef();
	if ( pMultiDef == NULL )
	{
		DEBUG_ERR(( "Bad Multi type 0%x, uid=0%x\n", GetID(), (DWORD) GetUID()));
		return false;
	}

	if ( m_pRegion == NULL )
	{
		RESOURCE_ID rid;
		rid.SetPrivateUID( GetUID());
		m_pRegion = new CRegionWorld( rid );
	}

	// Get Background region.
	CPointMap pt = GetTopPoint();
	const CRegionWorld * pRegionBack = dynamic_cast <CRegionWorld*> (pt.GetRegion( REGION_TYPE_AREA ));
	ASSERT( pRegionBack );
	ASSERT( pRegionBack != m_pRegion );

	// Create the new region rectangle.
	CRectMap rect;
	reinterpret_cast<CGRect&>(rect) = pMultiDef->m_rect;
	rect.OffsetRect( pt.m_x, pt.m_y );
	m_pRegion->SetRegionRect( rect );
	m_pRegion->m_pt = pt;

	DWORD dwFlags;
	if ( IsType(IT_SHIP))
	{
		dwFlags = REGION_FLAG_SHIP;
	}
	else
	{
		// Houses get some of the attribs of the land around it.
		dwFlags = pRegionBack->GetRegionFlags();
	}
	dwFlags |= pMultiDef->m_dwRegionFlags;
	m_pRegion->SetRegionFlags( dwFlags );

	TCHAR *pszTemp = Str_GetTemp();
	sprintf(pszTemp, "%s (%s)", (LPCTSTR) pRegionBack->GetName(), (LPCTSTR) GetName());
	m_pRegion->SetName(pszTemp);

	return m_pRegion->RealizeRegion();
}
开发者ID:GenerationOfWorlds,项目名称:Sphere,代码行数:54,代码来源:CItemMulti.cpp


示例10: if

 bool FundamentalValue::GetAsDouble(double* out_value) const
 {
     if(out_value && IsType(TYPE_DOUBLE))
     {
         *out_value = double_value_;
     }
     else if(out_value && IsType(TYPE_INTEGER))
     {
         *out_value = integer_value_;
     }
     return (IsType(TYPE_DOUBLE) || IsType(TYPE_INTEGER));
 }
开发者ID:abyvaltsev,项目名称:putty-nd3.x,代码行数:12,代码来源:value.cpp


示例11: assert

/*
================
idClass::ProcessEventArgPtr
================
*/
bool idClass::ProcessEventArgPtr( const idEventDef *ev, int *data )
{
	idTypeInfo	*c;
	int			num;
	eventCallback_t	callback;
	
	assert( ev );
	assert( idEvent::initialized );
	
#ifdef _D3XP
	SetTimeState ts;
	
	if( IsType( idEntity::Type ) )
	{
		idEntity *ent = ( idEntity * )this;
		ts.PushState( ent->timeGroup );
	}
#endif
	
	if( g_debugTriggers.GetBool() && ( ev == &EV_Activate ) && IsType( idEntity::Type ) )
	{
		const idEntity *ent = *reinterpret_cast<idEntity **>( data );
		gameLocal.Printf( "%d: '%s' activated by '%s'\n", gameLocal.framenum, static_cast<idEntity *>( this )->GetName(), ent ? ent->GetName() : "NULL" );
	}
	
	c = GetType();
	num = ev->GetEventNum();
	if( !c->eventMap[ num ] )
	{
		// we don't respond to this event, so ignore it
		return false;
	}	
	callback = c->eventMap[ num ];
	
	switch( ev->GetFormatspecIndex() )
	{
		case 1 << D_EVENT_MAXARGS :
			( this->*callback )();
			break;
			
			// generated file - see CREATE_EVENT_CODE
#include "Callbacks.cpp"
			
		default:
			gameLocal.DWarning( "Invalid formatspec on event '%s'", ev->GetName() );
			break;
	}	
	return true;
}
开发者ID:revelator,项目名称:MHDoom,代码行数:54,代码来源:Class.cpp


示例12: free

//
// Setting the size of the target array to hold the number and type of 
// targets specified.  If the requested number of targets is 0, the 
// array will be freed.
//
BOOL Grunt::Size_Target_Array( int count, const Target_Spec *target_specs )
{
	int i;

	// Free all current targets.  This is needed in case the newer targets
	// are of a different type, even if we have the same number of targets.
	for ( i = 0; i < target_count; i++ )
		delete targets[i];
	target_count = 0;

	// Reset the grunt's target type.
	type = InvalidType;

	// Release the memory if everything is being freed.
	if ( !count || !target_specs )
	{
		free(targets);
		targets = NULL;
		return TRUE;
	}

	// Allocate enough pointers to refer to all targets.
	targets = (Target**)realloc( targets, sizeof(Target*) * count );
	if ( !targets )
		return FALSE;

	// Create the requested number of targets.
	for ( i = 0; i < count; i++ )
	{
		type = (TargetType)(type | target_specs[i].type);

		if ( IsType( target_specs[i].type, GenericDiskType ) )
			targets[i] = new TargetDisk;
		else if ( IsType( target_specs[i].type, GenericTCPType ) )
			targets[i] = new TargetTCP;
#if defined(NO_DYNAMO_VI)
 // nop
#else
		else if ( IsType( target_specs[i].type, GenericVIType ) )
			targets[i] = new TargetVI;
#endif // NO_DYNAMO_VI

		if ( !targets[i] )
			return FALSE;
	}

	target_count = count;
	return TRUE;
}
开发者ID:BackupTheBerlios,项目名称:iometer-svn,代码行数:54,代码来源:IOGrunt.cpp


示例13: Calc_GetRandVal

void CItem::Spawn_OnTick( bool fExec )
{
	int iMinutes;
	if ( m_itSpawnChar.m_TimeHiMin <= 0 )
	{
		iMinutes = Calc_GetRandVal(30) + 1;
	}
	else
	{
		iMinutes = min( m_itSpawnChar.m_TimeHiMin, m_itSpawnChar.m_TimeLoMin ) + Calc_GetRandVal( abs( m_itSpawnChar.m_TimeHiMin - m_itSpawnChar.m_TimeLoMin ));
	}

	if ( iMinutes <= 0 )
		iMinutes = 1;

	if ( !fExec || IsTimerExpired() )
	{
		SetTimeout( iMinutes * 60 * TICK_PER_SEC );	// set time to check again.
	}

	if ( ! fExec )
		return;

	CResourceDef * pDef = Spawn_FixDef();
	if ( pDef == NULL )
	{
		RESOURCE_ID_BASE rid;
		if ( IsType(IT_SPAWN_ITEM))
		{
			rid = m_itSpawnItem.m_ItemID;
		}
		else
		{
			rid = m_itSpawnChar.m_CharID;
		}
		DEBUG_ERR(( "Bad Spawn point uid=0%lx, id=%s\n", (DWORD) GetUID(), g_Cfg.ResourceGetName(rid) ));
		return;
	}

	if ( IsType(IT_SPAWN_ITEM))
	{
		Spawn_GenerateItem(pDef);
	}
	else
	{
		Spawn_GenerateChar(pDef);
	}
}
开发者ID:GenerationOfWorlds,项目名称:Sphere,代码行数:48,代码来源:CItemSp.cpp


示例14: Transpose

//-------------------------------------------------------------------
bool cpp_xloper::Transpose(void)
{
   if(!IsType(xltypeMulti))
      return false;

   WORD r, c, rows, columns;

   GetArraySize(rows, columns);

   xloper *new_array = (xloper *)malloc(sizeof(xloper) * rows * columns);
   xloper *p_source = m_Op.val.array.lparray;
   int new_index;

   for(r = 0; r < rows; r++)
   {
      new_index = r;

      for(c = 0; c < columns; c++, new_index += rows)
      {
         new_array[new_index] = *p_source++;
      }
   }

   r = m_Op.val.array.columns;
   m_Op.val.array.columns = m_Op.val.array.rows;
   m_Op.val.array.rows = r;

   memcpy(m_Op.val.array.lparray, new_array, sizeof(xloper) * rows * columns);
   free(new_array);
   return true;
}
开发者ID:daveysj,项目名称:sjd,代码行数:32,代码来源:cpp_xloper.cpp


示例15: assert

/*
================
idClass::PostEventArgs
================
*/
bool idClass::PostEventArgs( const idEventDef *ev, int time, int numargs, ... ) {
	idTypeInfo	*c;
	idEvent		*event;
	va_list		args;

	assert( ev );

	if ( !idEvent::initialized ) {
		return false;
	}

	c = GetType();
	if ( !c->eventMap[ ev->GetEventNum() ] ) {
		// we don't respond to this event, so ignore it
		return false;
	}

	// we service events on the client to avoid any bad code filling up the event pool
	// we don't want them processed usually, unless when the map is (re)loading.
	// we allow threads to run fine, though.
	if ( gameLocal.isClient && ( gameLocal.GameState() != GAMESTATE_STARTUP ) && !IsType( idThread::Type ) ) {
		return true;
	}

	va_start( args, numargs );
	event = idEvent::Alloc( ev, numargs, args );
	va_end( args );

	event->Schedule( this, c, time );

	return true;
}
开发者ID:4DA,项目名称:doom3.gpl,代码行数:37,代码来源:Class.cpp


示例16: switch

//
// Displays the connection rate settings for the current selection in the
// worker view.  If the selection is a manager or all managers, displays
// a value if all the children's values are the same.
//
void CPageNetwork::ShowConnectionRate()
{
	Manager *manager;
	Worker	*worker;
	int		trans_per_conn;
	int		test_connection_rate;

	switch ( theApp.pView->m_pWorkerView->GetSelectedType() )
	{
	case WORKER:
		worker = theApp.pView->m_pWorkerView->GetSelectedWorker();
		// update controls with worker's data
		if ( IsType( worker->Type(), GenericNetType ) )
		{
			trans_per_conn = worker->GetTransPerConn( GenericNetType );
			test_connection_rate = worker->GetConnectionRate( GenericNetType );
		}
		break;
	case MANAGER:
		manager = theApp.pView->m_pWorkerView->GetSelectedManager();
		trans_per_conn = manager->GetTransPerConn( GenericServerType );
		test_connection_rate = manager->GetConnectionRate( GenericServerType );
		break;
	default:
		trans_per_conn = 
			theApp.manager_list.GetTransPerConn( GenericServerType );
		test_connection_rate = 
			theApp.manager_list.GetConnectionRate( GenericServerType );
		break;
	}
	// If the test connection rate settings are different between a manager's
	// workers, set the state of the check box to AUTO3STATE and disable the
	// edit box and spin control.
	SetDlgItemInt( EConnectionRate, trans_per_conn );
	if ( test_connection_rate == AMBIGUOUS_VALUE )
	{
		m_CConnectionRate.SetButtonStyle( BS_AUTO3STATE );
		m_EConnectionRate.SetPasswordChar( 32 );
		m_EConnectionRate.Invalidate( TRUE );

		// Set check box to undetermined state.
		CheckDlgButton( CConnectionRate, 2 );
	}
	else
	{
		m_CConnectionRate.SetButtonStyle( BS_AUTOCHECKBOX );
		CheckDlgButton( CConnectionRate, test_connection_rate );

		if ( test_connection_rate == ENABLED_VALUE && trans_per_conn != 
			AMBIGUOUS_VALUE )
		{
			m_EConnectionRate.SetPasswordChar( 0 );
		}
		else
		{
			m_EConnectionRate.SetPasswordChar( 32 );
			m_EConnectionRate.Invalidate();
		}
	}
}
开发者ID:BackupTheBerlios,项目名称:iometer-svn,代码行数:65,代码来源:PageNetwork.cpp


示例17: Get3DViewerFrame

bool PCB_BASE_FRAME::Update3DView( const wxString* aTitle )
{
    // Update the 3D view only if the viewer is opened by this frame
    EDA_3D_VIEWER* draw3DFrame = Get3DViewerFrame();

    if( draw3DFrame == NULL )
        return false;

    // Ensure the viewer was created by me, and not by another editor:
    PCB_BASE_FRAME* owner = draw3DFrame->Parent();

    // if I am not the owner, do not use the current viewer instance
    if( this != owner )
        return false;

    if( aTitle )
        draw3DFrame->SetTitle( *aTitle );

    // The 3D view update can be time consumming to rebuild a board 3D view.
    // So do not use a immediate update in the board editor
    bool immediate_update = true;

    if( IsType( FRAME_PCB ) )
        immediate_update = false;

    draw3DFrame->NewDisplay( immediate_update );

    return true;
}
开发者ID:KiCad,项目名称:kicad-source-mirror,代码行数:29,代码来源:pcb_base_frame.cpp


示例18: ParseParam

/* Parse a parameter. Currently only supports normal ones. */
Param ParseParam(VyObj param, bool opt, bool rest){
    VyObj default_val = None();
    if(opt){
        if(IsType(param, TypeCons)){
            VyObj name = ListGet(UNWRAP(param, VyCons), 0);

            default_val = ListGet(UNWRAP(param, VyCons), 0);
            param = name;
        }
    }

    Param p = {optional: opt,
        rest: rest,
        default_value: default_val,
        name: UNWRAP(param, VySymbol)};
    return p;
}

/* Find how many actual parameters there are */
int CountParams(VyObj list){
    int count = 0;
    while(!IsNil(list)){
        if(!ObjEq(Car(list), CreateSymbol("?")) && 
           !ObjEq(Car(list), CreateSymbol("..")))
                count++;

        list = Cdr(list);
    }

    return count;
}
开发者ID:overzeroe,项目名称:Vyquon,代码行数:32,代码来源:Function.c


示例19: GetGridOrigin

bool PCB_BASE_FRAME::InvokeDialogGrid()
{
    wxPoint grid_origin = GetGridOrigin();

    DIALOG_SET_GRID dlg( this, &m_UserGridUnit, g_UserUnit, &m_UserGridSize,
        &grid_origin, &m_FastGrid1, &m_FastGrid2,
        m_gridSelectBox->GetStrings() );

    int ret = dlg.ShowModal();

    if( ret == wxID_OK )
    {
        if( GetGridOrigin() != grid_origin && IsType( FRAME_PCB ) )
            OnModify();     // because grid origin is saved in board, show as modified

        SetGridOrigin( grid_origin );

        GetScreen()->AddGrid( m_UserGridSize, m_UserGridUnit, ID_POPUP_GRID_USER );

        // If the user grid is the current option, recall SetGrid()
        // to force new values put in list as current grid value
        if( GetScreen()->GetGridId() == ID_POPUP_GRID_USER )
            GetScreen()->SetGrid( ID_POPUP_GRID_USER  );

        m_canvas->Refresh();

        return true;
    }

    return false;
}
开发者ID:Elphel,项目名称:kicad-source-mirror,代码行数:31,代码来源:dialog_set_grid.cpp


示例20: defined

//
// Grunt destructor.
//
Grunt::~Grunt()
{
	// Remove completion queue, if any.
	if ( (type != InvalidType) && !IsType(type, GenericVIType) && io_cq )
		delete io_cq;

	Size_Target_Array( 0 );

	// Release grunt's I/O data buffers if they are in use.
	if ( data_size )
#if defined(IOMTR_OSFAMILY_NETWARE)
		NXMemFree( read_data );
		NXMemFree( write_data );
#elif defined(IOMTR_OSFAMILY_UNIX)
		free( read_data );
		free( write_data );
#elif defined(IOMTR_OSFAMILY_WINDOWS)
		VirtualFree( read_data, 0, MEM_RELEASE );
		VirtualFree( write_data, 0, MEM_RELEASE );
#else
 #warning ===> WARNING: You have to do some coding here to get the port done!
#endif

	Free_Transaction_Arrays();
}
开发者ID:BackupTheBerlios,项目名称:iometer-svn,代码行数:28,代码来源:IOGrunt.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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