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


C++ Destroy函数代码示例

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


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

示例1: Destroy

int CShrapnelManager::Update (CObject* objP)
{
if ((objP->LifeLeft () <= 0) || !m_data.buffer [objP->Index ()].Update ())
	Destroy (objP);
return 0;
}
开发者ID:paud,项目名称:d2x-xl,代码行数:6,代码来源:shrapnel.cpp

示例2: assert

void
TopCanvas::Create(PixelSize new_size,
                  bool full_screen, bool resizable)
{
#ifdef USE_FB
  assert(fd < 0);

#ifdef USE_TTY
  InitialiseTTY();
#endif

  const char *path = "/dev/fb0";
  fd = open(path, O_RDWR | O_NOCTTY | O_CLOEXEC);
  if (fd < 0) {
    fprintf(stderr, "Failed to open %s: %s\n", path, strerror(errno));
    return;
  }

  struct fb_fix_screeninfo finfo;
  if (ioctl(fd, FBIOGET_FSCREENINFO, &finfo) < 0) {
    fprintf(stderr, "FBIOGET_FSCREENINFO failed: %s\n", strerror(errno));
    Destroy();
    return;
  }

  if (finfo.type != FB_TYPE_PACKED_PIXELS) {
    fprintf(stderr, "Unsupported console hardware\n");
    Destroy();
    return;
  }

  switch (finfo.visual) {
  case FB_VISUAL_TRUECOLOR:
  case FB_VISUAL_PSEUDOCOLOR:
  case FB_VISUAL_STATIC_PSEUDOCOLOR:
  case FB_VISUAL_DIRECTCOLOR:
    break;

  default:
    fprintf(stderr, "Unsupported console hardware\n");
    Destroy();
    return;
  }

  /* Memory map the device, compensating for buggy PPC mmap() */
  const off_t page_size = getpagesize();
  off_t offset = off_t(finfo.smem_start)
    - (off_t(finfo.smem_start) &~ (page_size - 1));
  off_t map_size = finfo.smem_len + offset;

  map = mmap(nullptr, map_size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
  if (map == (void *)-1) {
    fprintf(stderr, "Unable to memory map the video hardware: %s\n",
            strerror(errno));
    map = nullptr;
    Destroy();
    return;
  }

  /* Determine the current screen depth */
  struct fb_var_screeninfo vinfo;
  if (ioctl(fd, FBIOGET_VSCREENINFO, &vinfo) < 0 ) {
    fprintf(stderr, "Couldn't get console pixel format: %s\n",
            strerror(errno));
    Destroy();
    return;
  }

#ifdef GREYSCALE
  /* switch the frame buffer to 8 bits per pixel greyscale */

  vinfo.bits_per_pixel = 8;
  vinfo.grayscale = true;

  if (ioctl(fd, FBIOPUT_VSCREENINFO, &vinfo) < 0) {
    fprintf(stderr, "Couldn't set greyscale pixel format: %s\n",
            strerror(errno));
    Destroy();
    return;
  }

  /* read new finfo */
  ioctl(fd, FBIOGET_FSCREENINFO, &finfo);

  map_bpp = 1;
#else
  map_bpp = vinfo.bits_per_pixel / 8;
  if (map_bpp != 2 && map_bpp != 4) {
    fprintf(stderr, "Unsupported console hardware\n");
    Destroy();
    return;
  }
#endif

  map_pitch = finfo.line_length;
  epd_update_marker = 0;

#ifdef KOBO
  ioctl(fd, MXCFB_SET_UPDATE_SCHEME, UPDATE_SCHEME_QUEUE_AND_MERGE);
#endif
//.........这里部分代码省略.........
开发者ID:nkgautam,项目名称:XCSoar,代码行数:101,代码来源:TopCanvas.cpp

示例3: Destroy

Application::~Application()
{
  Destroy ();
}
开发者ID:superhawk236,项目名称:Lte,代码行数:4,代码来源:Application.cpp

示例4: Destroy

void AProjectile::TimerExpired()
{
	Destroy();
}
开发者ID:cabrinhaFx,项目名称:BattleTank,代码行数:4,代码来源:Projectile.cpp

示例5: test

void test ()
{	
	BinarySort * tree = Init(10);
	
	uint64_t* nombresPremiers1 = ( uint64_t* ) malloc( sizeof( uint64_t ) * 64 );
	nombresPremiers1[0] = 2;
	nombresPremiers1[1] = 3;
	nombresPremiers1[2] = 5;
	Decomposition *dec1 = (Decomposition*) malloc (sizeof(Decomposition));
	dec1 -> value = 30;
	dec1 -> tabSize = 3;
	dec1 -> primeNumbers = nombresPremiers1;
	
	uint64_t* nombresPremiers2 = ( uint64_t* ) malloc( sizeof( uint64_t ) * 64 );
	nombresPremiers2[0] = 2;
	nombresPremiers2[1] = 2;
	nombresPremiers2[2] = 7;
	Decomposition *dec2 = (Decomposition*) malloc (sizeof(Decomposition));
	dec2 -> value = 28;
	dec2 -> tabSize = 3;
	dec2 -> primeNumbers = nombresPremiers2;
	
	uint64_t* nombresPremiers5 = ( uint64_t* ) malloc( sizeof( uint64_t ) * 64 );
	nombresPremiers5[0] = 29;
	Decomposition *dec5 = (Decomposition*) malloc (sizeof(Decomposition));
	dec5 -> value = 29;
	dec5 -> tabSize = 1;
	dec5 -> primeNumbers = nombresPremiers5;
	
	uint64_t* nombresPremiers3 = ( uint64_t* ) malloc( sizeof( uint64_t ) * 64 );
	nombresPremiers3[0] = 3;
	nombresPremiers3[1] = 3;
	nombresPremiers3[2] = 11;
	Decomposition *dec3 = (Decomposition*) malloc (sizeof(Decomposition));
	dec3 -> value = 99;
	dec3 -> tabSize = 3;
	dec3 -> primeNumbers = nombresPremiers3;
	
	uint64_t* nombresPremiers4 = ( uint64_t* ) malloc( sizeof( uint64_t ) * 64 );
	nombresPremiers4[0] = 2;
	nombresPremiers4[1] = 2;
	Decomposition *dec4 = (Decomposition*) malloc (sizeof(Decomposition));
	dec4 -> value = 4;
	dec4 -> tabSize = 2;
	dec4 -> primeNumbers = nombresPremiers4;
	
	InsertValue(tree,dec1);
	InsertValue(tree,dec4);
	InsertValue(tree,dec2);
	InsertValue(tree,dec5);
	InsertValue(tree,dec3);

	printf("%d\r\n", tree->filled);

	int indiceTab=0;
	int compteurValeur=0;
	int j;
	while ( compteurValeur < tree->filled )
	{	if (tree->array[indiceTab] != NULL)
		{	printf( "indice : " );
			printf( "%d\r\n" , indiceTab );
			printf( "%ju\r\n" , tree->array[indiceTab]->value);
			for ( j = 0 ; j < tree -> array[indiceTab] -> tabSize ; j++ )
			{	
				printf( "%ju\r\n" , tree -> array[indiceTab] -> primeNumbers[j] );
			}
		 	compteurValeur++;
		}
	 	indiceTab++;
	}


	Destroy (tree);


	
}
开发者ID:LucaHennart,项目名称:TP-4_MultiThread,代码行数:77,代码来源:saveQ10.c

示例6: Destroy

apoAttrCalcHelper::apoAttrCalcHelper()
{

	m_current_parse = 0;
	Destroy();
}
开发者ID:neil78duan,项目名称:apollolib,代码行数:6,代码来源:apoAttrCalcHelper.cpp

示例7: EndModal

void gConfigDialog::OnCancel(wxCommandEvent &event)
{
    EndModal(wxID_CANCEL);
    Destroy();
}
开发者ID:jp-bennett,项目名称:fwknop-gui,代码行数:5,代码来源:general_config.cpp

示例8: Destroy

COptionDialog::~COptionDialog()
{
	Destroy();
}
开发者ID:ACUVE,项目名称:TVTest,代码行数:4,代码来源:OptionDialog.cpp

示例9: Destroy

BOOL CNetFile::Download(LPCTSTR pUrl, LPCTSTR pLocal, BOOL bCloseFileAfterDownload, HWND hWndParent)
{_STT();
	// Lose previous file
	Destroy();

	// Downloading
	m_bUpload = FALSE;

	// Save parent window
	m_hWndParent = hWndParent;

	// Save close file status
	m_bCloseFileAfterDownload = bCloseFileAfterDownload;

	// Sanity check
	if ( pUrl == NULL || *pUrl == NULL ) return FALSE;

	// Are we downloading to file or ram?
	m_bMem = ( pLocal == NULL );

	{ // Copy the url
		
		char buf[ sizeof( m_szUrl ) ];
		DWORD size = sizeof( m_szUrl ) - 1;

		// Is it a local file?
		if ( GetFileAttributes( pUrl ) == MAXDWORD )
		{
			// Fix the url
			if ( InternetCanonicalizeUrl( pUrl, buf, &size, 0 ) )
			{	strcpy_sz( m_szUrl, buf ); }

			// Copy the url name
			else strcpy_sz( m_szUrl, pUrl );
		} // end if
		
		// Copy the local file name
		else strcpy_sz( m_szUrl, pUrl );

	} // end copy url	

	// Is it a local file?
	if ( GetFileAttributes( m_szUrl ) != MAXDWORD )
	{
		CWinFile	file;

		if ( file.OpenExisting( m_szUrl, GENERIC_READ ) )
		{
			DWORD size = file.Size();

			if ( m_bMem )
			{
				// Allocate memory
				m_pMem = new BYTE[ size + 1 ];
				if ( m_pMem == NULL ) 
				{	m_dwTransferStatus = NETFILE_DS_ERROR;
					return FALSE;
				} // end if

				// Read in the file
				if ( !file.Read( m_pMem, size, &m_dwDataRead ) )
				{	m_dwTransferStatus = NETFILE_DS_ERROR;
					return FALSE;
				} // end if

				// NULL terminate for good measure
				m_pMem[ size ] = 0;

			} // end if

			else
			{
				// Where to download the file
				if ( pLocal != DOWNLOADTEMP ) { strcpy_sz( m_szLocal, pLocal ); }
				else CWinFile::CreateTemp( m_szLocal );	

				// Copy the file
				CopyFile( m_szUrl, m_szLocal, FALSE );

				// Open the file
				if ( !m_local.OpenExisting( m_szLocal, GENERIC_READ | GENERIC_WRITE ) )
				{	m_dwTransferStatus = NETFILE_DS_ERROR;
					return FALSE;
				} // end if

				// Get the file size
				m_dwDataRead = m_local.Size();

			} // end else

			// Memory read complete
			m_dwTransferStatus = NETFILE_DS_DONE;

			return TRUE;

		} // end if

	} // end if

	if ( !m_bMem )
//.........这里部分代码省略.........
开发者ID:mvancompernolle,项目名称:ai_project,代码行数:101,代码来源:NetFile.cpp

示例10: Net_WriteByte

void DAutosaver::Tick ()
{
	Net_WriteByte (DEM_CHECKAUTOSAVE);
	Destroy ();
}
开发者ID:NeoNet-Network,项目名称:gzdoom,代码行数:5,代码来源:g_level.cpp

示例11: main


//.........这里部分代码省略.........
   }

   /* Parse command line options. */
   action = ACTION_RUN;
   for(x = 1; x < argc; x++) {
      if(!strcmp(argv[x], "-v")) {
         DisplayAbout();
         DoExit(0);
      } else if(!strcmp(argv[x], "-h")) {
         DisplayHelp();
         DoExit(0);
      } else if(!strcmp(argv[x], "-p")) {
         action = ACTION_PARSE;
      } else if(!strcmp(argv[x], "-restart")) {
         action = ACTION_RESTART;
      } else if(!strcmp(argv[x], "-exit")) {
         action = ACTION_EXIT;
      } else if(!strcmp(argv[x], "-reload")) {
         action = ACTION_RELOAD;
      } else if(!strcmp(argv[x], "-display") && x + 1 < argc) {
         displayString = argv[++x];
      } else if(!strcmp(argv[x], "-f") && x + 1 < argc) {
         Release(configPath);
         configPath = CopyString(argv[++x]);
      } else {
         printf("unrecognized option: %s\n", argv[x]);
         DisplayHelp();
         DoExit(1);
      }
   }

   switch(action) {
   case ACTION_PARSE:
      Initialize();
      ParseConfig(configPath);
      DoExit(0);
   case ACTION_RESTART:
      SendRestart();
      DoExit(0);
   case ACTION_EXIT:
      SendExit();
      DoExit(0);
   case ACTION_RELOAD:
      SendReload();
      DoExit(0);
   default:
      break;
   }

#if defined(HAVE_SETLOCALE) && defined(ENABLE_NLS)
   setlocale(LC_ALL, "");
#endif
#ifdef HAVE_GETTEXT
   bindtextdomain("jwm", LOCALEDIR);
   textdomain("jwm");
#endif

   /* The main loop. */
   StartupConnection();
   do {

      isRestarting = shouldRestart;
      shouldExit = 0;
      shouldRestart = 0;
      shouldReload = 0;

      /* Prepare JWM components. */
      Initialize();

      /* Parse the configuration file. */
      ParseConfig(configPath);

      /* Start up the JWM components. */
      Startup();

      /* The main event loop. */
      EventLoop();

      /* Shutdown JWM components. */
      Shutdown();

      /* Perform any extra cleanup. */
      Destroy();

   } while(shouldRestart);
   ShutdownConnection();

   /* If we have a command to execute on shutdown, run it now. */
   if(exitCommand) {
      execl(SHELL_NAME, SHELL_NAME, "-c", exitCommand, NULL);
      Warning(_("exec failed: (%s) %s"), SHELL_NAME, exitCommand);
      DoExit(1);
   } else {
      DoExit(0);
   }

   /* Control shoud never get here. */
   return -1;

}
开发者ID:pecarter-work,项目名称:jwm,代码行数:101,代码来源:main.c

示例12: Destroy

CMenuItemList::~CMenuItemList()
{	Destroy();
}
开发者ID:sanyaade-webdev,项目名称:wpub,代码行数:3,代码来源:MenuItemList.cpp

示例13: while


//.........这里部分代码省略.........
      //MAX_EXCEPTION_COUNT exceptions in a row? -> bail out
      if (processExceptionCount > MAX_EXCEPTION_COUNT)
      {
        CLog::Log(LOGERROR, "CApplication::Process(), too many exceptions");
        throw;
      }
    }
    catch (...)
    {
      CLog::Log(LOGERROR, "exception in CApplication::Process()");
      processExceptionCount++;
      //MAX_EXCEPTION_COUNT exceptions in a row? -> bail out
      if (processExceptionCount > MAX_EXCEPTION_COUNT)
      {
        CLog::Log(LOGERROR, "CApplication::Process(), too many exceptions");
        throw;
      }
    }
#endif
    // Frame move the scene
#ifdef XBMC_TRACK_EXCEPTIONS
    try
    {
#endif
      if (!m_bStop) FrameMove(true, m_renderGUI);
      //reset exception count
#ifdef XBMC_TRACK_EXCEPTIONS
      frameMoveExceptionCount = 0;

    }
    catch (const XbmcCommons::UncheckedException &e)
    {
      e.LogThrowMessage("CApplication::FrameMove()");
      frameMoveExceptionCount++;
      //MAX_EXCEPTION_COUNT exceptions in a row? -> bail out
      if (frameMoveExceptionCount > MAX_EXCEPTION_COUNT)
      {
        CLog::Log(LOGERROR, "CApplication::FrameMove(), too many exceptions");
        throw;
      }
    }
    catch (...)
    {
      CLog::Log(LOGERROR, "exception in CApplication::FrameMove()");
      frameMoveExceptionCount++;
      //MAX_EXCEPTION_COUNT exceptions in a row? -> bail out
      if (frameMoveExceptionCount > MAX_EXCEPTION_COUNT)
      {
        CLog::Log(LOGERROR, "CApplication::FrameMove(), too many exceptions");
        throw;
      }
    }
#endif

    // Render the scene
#ifdef XBMC_TRACK_EXCEPTIONS
    try
    {
#endif
      if (m_renderGUI && !m_bStop) Render();
      else if (!m_renderGUI)
      {
        frameTime = XbmcThreads::SystemClockMillis() - lastFrameTime;
        if(frameTime < noRenderFrameTime)
          Sleep(noRenderFrameTime - frameTime);
      }
#ifdef XBMC_TRACK_EXCEPTIONS
      //reset exception count
      renderExceptionCount = 0;

    }
    catch (const XbmcCommons::UncheckedException &e)
    {
      e.LogThrowMessage("CApplication::Render()");
      renderExceptionCount++;
      //MAX_EXCEPTION_COUNT exceptions in a row? -> bail out
      if (renderExceptionCount > MAX_EXCEPTION_COUNT)
      {
        CLog::Log(LOGERROR, "CApplication::Render(), too many exceptions");
        throw;
      }
    }
    catch (...)
    {
      CLog::Log(LOGERROR, "exception in CApplication::Render()");
      renderExceptionCount++;
      //MAX_EXCEPTION_COUNT exceptions in a row? -> bail out
      if (renderExceptionCount > MAX_EXCEPTION_COUNT)
      {
        CLog::Log(LOGERROR, "CApplication::Render(), too many exceptions");
        throw;
      }
    }
#endif
  } // while (!m_bStop)
  Destroy();

  CLog::Log(LOGNOTICE, "application stopped..." );
  return m_ExitCode;
}
开发者ID:Nomoreillusion,项目名称:kodi-cmake,代码行数:101,代码来源:XBApplicationEx.cpp

示例14: Destroy

void JavaString::Reset(const JavaString& str) {
	Destroy();
	JavaObject::Reset(str);
	Init();
}
开发者ID:JMQCode,项目名称:CppJni,代码行数:5,代码来源:JniJavaString.cpp

示例15: Destroy

void Menu::CreatePopUp()
{
    Destroy();
    mid = new QsciSciPopup();
}
开发者ID:OFFIS-Automation,项目名称:Framework,代码行数:5,代码来源:PlatQt.cpp


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