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


C++ checkStatus函数代码示例

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


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

示例1: checkStatus

void DDSEntityManager::deleteFilteredTopic()
{
  status = participant->delete_contentfilteredtopic(filteredTopic);
  checkStatus(status, "DDS.DomainParticipant.delete_topic");
}
开发者ID:osrf,项目名称:opensplice,代码行数:5,代码来源:DDSEntityManager.cpp

示例2: load

    bool load(CFURLRef url) {

        OSStatus status;
        memset(&aqData,0,sizeof(aqData));
        timeBase = 0;
        
        status = AudioFileOpenURL(url,kAudioFileReadPermission,0,&aqData.mAudioFile);
        checkStatus(status);
        if( status != noErr ) return false;
        
        UInt32 dataFormatSize = sizeof (aqData.mDataFormat);    // 1

        status = AudioFileGetProperty (                                  // 2
            aqData.mAudioFile,                                  // 3
            kAudioFilePropertyDataFormat,                       // 4
            &dataFormatSize,                                    // 5
            &aqData.mDataFormat                                 // 6
        );
        checkStatus(status);

        status = AudioQueueNewOutput (                                // 1
            &aqData.mDataFormat,                             // 2
            HandleOutputBuffer,                              // 3
            &aqData,                                         // 4
            CFRunLoopGetCurrent (),                          // 5
            kCFRunLoopCommonModes,                           // 6
            0,                                               // 7
            &aqData.mQueue                                   // 8
        );
        checkStatus(status);

        UInt32 maxPacketSize;
        UInt32 propertySize = sizeof (maxPacketSize);
        status = AudioFileGetProperty (                               // 1
            aqData.mAudioFile,                               // 2
            kAudioFilePropertyPacketSizeUpperBound,          // 3
            &propertySize,                                   // 4
            &maxPacketSize                                   // 5
        );
        checkStatus(status);

        deriveBufferSize (                                   // 6
            aqData.mDataFormat,                              // 7
            maxPacketSize,                                   // 8
            0.5,                                             // 9
            &aqData.bufferByteSize,                          // 10
            &aqData.mNumPacketsToRead                        // 11
        );
        
        bool isFormatVBR = (                                       // 1
            aqData.mDataFormat.mBytesPerPacket == 0 ||
            aqData.mDataFormat.mFramesPerPacket == 0
        );

        if (isFormatVBR) {                                         // 2
            aqData.mPacketDescs =
              (AudioStreamPacketDescription*) malloc (
                aqData.mNumPacketsToRead * sizeof (AudioStreamPacketDescription)
              );
        } else {                                                   // 3
            aqData.mPacketDescs = NULL;
        }

        UInt32 cookieSize = sizeof (UInt32);                   // 1
        OSStatus couldNotGetProperty =                             // 2
            AudioFileGetPropertyInfo (                         // 3
                aqData.mAudioFile,                             // 4
                kAudioFilePropertyMagicCookieData,             // 5
                &cookieSize,                                   // 6
                NULL                                           // 7
            );
    //    checkStatus(couldNotGetProperty);
        if (!couldNotGetProperty && cookieSize) {              // 8
            char* magicCookie =
                (char *) malloc (cookieSize);

            status = AudioFileGetProperty (                             // 9
                aqData.mAudioFile,                             // 10
                kAudioFilePropertyMagicCookieData,             // 11
                &cookieSize,                                   // 12
                magicCookie                                    // 13
            );
        checkStatus(status);

            status = AudioQueueSetProperty (                            // 14
                aqData.mQueue,                                 // 15
                kAudioQueueProperty_MagicCookie,               // 16
                magicCookie,                                   // 17
                cookieSize                                     // 18
            );
        checkStatus(status);

            free (magicCookie);                                // 19
        }

        return true;
    }
开发者ID:sammyshj,项目名称:assignment,代码行数:97,代码来源:AudioPlayer.cpp

示例3: onAccess

bool WebGLFramebuffer::onAccess(GraphicsContext3D* context3d, const char** reason)
{
    if (checkStatus(reason) != GraphicsContext3D::FRAMEBUFFER_COMPLETE)
        return false;
    return true;
}
开发者ID:windyuuy,项目名称:opera,代码行数:6,代码来源:WebGLFramebuffer.cpp

示例4: checkStatus

void DDSEntityManager::deleteReader(DDS::DataReader_ptr dataReader)
{
    status = subscriber->delete_datareader(dataReader);
    checkStatus(status, "DDS::Subscriber::delete_datareader ");
}
开发者ID:shizhexu,项目名称:opensplice,代码行数:5,代码来源:DDSEntityManager.cpp

示例5: deleteContainedEntities

void deleteContainedEntities()
{
    // Recursively delete all entities in the DomainParticipant.
    g_status = DDS_DomainParticipant_delete_contained_entities(g_domainParticipant);
    checkStatus(g_status, "DDS_DomainParticipant_delete_contained_entities");
}
开发者ID:xrl,项目名称:opensplice_dds,代码行数:6,代码来源:DDSEntitiesManager.c

示例6: deleteParticipant

void deleteParticipant()
{
    g_status = DDS_DomainParticipantFactory_delete_participant(g_domainParticipantFactory, g_domainParticipant);
    checkStatus(g_status, "DDS_DomainParticipantFactory_delete_participant");
}
开发者ID:xrl,项目名称:opensplice_dds,代码行数:5,代码来源:DDSEntitiesManager.c

示例7: deleteSubscriber

void deleteSubscriber(DDS_Subscriber subscriber)
{
    g_status = DDS_DomainParticipant_delete_subscriber(g_domainParticipant, subscriber);
    checkStatus(g_status, "DDS_DomainParticipant_delete_subscriber");
}
开发者ID:xrl,项目名称:opensplice_dds,代码行数:5,代码来源:DDSEntitiesManager.c

示例8: deleteDataReader

void deleteDataReader(DDS_Subscriber subscriber, DDS_DataReader dataReader)
{
    g_status = DDS_Subscriber_delete_datareader(subscriber, dataReader);
    checkStatus(g_status, "DDS_Subscriber_delete_datareader");
}
开发者ID:xrl,项目名称:opensplice_dds,代码行数:5,代码来源:DDSEntitiesManager.c

示例9: checkGLSupport

void ofFbo::setup(Settings _settings) {
	checkGLSupport();

	destroy();

	if(_settings.width == 0) _settings.width = ofGetWidth();
	if(_settings.height == 0) _settings.height = ofGetHeight();
	settings = _settings;

	// create main fbo
	// this is the main one we bind for drawing into
	// all the renderbuffers are attached to this (whether MSAA is enabled or not)
	glGenFramebuffers(1, &fbo);
	retainFB(fbo);
	bind();

		
	// If we want both a depth AND a stencil buffer tehn combine them into a single buffer
#ifndef TARGET_OPENGLES
	if( settings.useDepth && settings.useStencil )
	{
		stencilBuffer = depthBuffer = createAndAttachRenderbuffer(GL_DEPTH_STENCIL, GL_DEPTH_STENCIL_ATTACHMENT);
		retainRB(depthBuffer);
		retainRB(stencilBuffer);
	}else
#endif
	{
		// if we want a depth buffer, create it, and attach to our main fbo
		if(settings.useDepth){
			depthBuffer = createAndAttachRenderbuffer(GL_DEPTH_COMPONENT, GL_DEPTH_ATTACHMENT);
			retainRB(depthBuffer);
		}

		// if we want a stencil buffer, create it, and attach to our main fbo
		if(settings.useStencil){
			stencilBuffer = createAndAttachRenderbuffer(GL_STENCIL_INDEX, GL_STENCIL_ATTACHMENT);
			retainRB(stencilBuffer);
		}
	}
	// if we want MSAA, create a new fbo for textures
#ifndef TARGET_OPENGLES
	if(settings.numSamples){
		glGenFramebuffers(1, &fboTextures);
		retainFB(fboTextures);
	}else{
		fboTextures = fbo;
	}
#else
	fboTextures = fbo;
	if(settings.numSamples){
		ofLog(OF_LOG_WARNING,"ofFbo: multisampling not supported in opengles");
	}
#endif
	// now create all textures and color buffers
	for(int i=0; i<settings.numColorbuffers; i++) createAndAttachTexture(i);

	// if textures are attached to a different fbo (e.g. if using MSAA) check it's status
	if(fbo != fboTextures) {
		glBindFramebuffer(GL_FRAMEBUFFER, fboTextures);
	}

	// check everything is ok with this fbo
	checkStatus();
	
	// unbind it
	unbind();
}
开发者ID:aleonard,项目名称:KinectWorkshop,代码行数:67,代码来源:ofFbo.cpp

示例10: OSPL_MAIN

int OSPL_MAIN (int argc, char *argv[])
{
   DDS_Subscriber QueryConditionDataSubscriber;
   DDS_DataReader QueryConditionDataDataReader;
   StockMarket_Stock* QueryConditionDataSample;
   DDS_sequence_StockMarket_Stock* msgList = DDS_sequence_StockMarket_Stock__alloc();
   DDS_SampleInfoSeq* infoSeq = DDS_SampleInfoSeq__alloc();
   c_bool isClosed = FALSE;
   unsigned long j;
   DDS_char* QueryConditionDataToSubscribe;
   DDS_char *query_string = "ticker=%0";
   DDS_QueryCondition queryCondition;
   os_time delay_200ms = { 0, 200000000 };
   int count = 0;

   // usage : QueryConditionSubscriber <topic's content filtering string>
   if( argc < 2 )
   {
      usage();
   }
   printf("\n\n Starting QueryConditionSubscriber...");
   printf("\n\n Parameter is \"%s\"", argv[1]);
   QueryConditionDataToSubscribe = argv[1];

   createParticipant("QueryCondition example");

   // Register Stock Topic's type in the DDS Domain.
   g_StockTypeSupport = (DDS_TypeSupport) StockMarket_StockTypeSupport__alloc();
   checkHandle(g_StockTypeSupport, "StockMarket_StockTypeSupport__alloc");
   registerStockType(g_StockTypeSupport);
   // Create Stock Topic in the DDS Domain.
   g_StockTypeName = StockMarket_StockTypeSupport_get_type_name(g_StockTypeSupport);
   g_StockTopic = createTopic("StockTrackerExclusive", g_StockTypeName);
   DDS_free(g_StockTypeName);
   DDS_free(g_StockTypeSupport);

   // Create the Subscriber's in the DDS Domain.
   QueryConditionDataSubscriber = createSubscriber();

   // Request a Reader from the the Subscriber.
   QueryConditionDataDataReader = createDataReader(QueryConditionDataSubscriber, g_StockTopic);

   // Create QueryCondition
   printf( "\n=== [QueryConditionSubscriber] Query : ticker = %s\n", QueryConditionDataToSubscribe );

   queryCondition = createQueryCondition(QueryConditionDataDataReader, query_string, (DDS_char*) QueryConditionDataToSubscribe);


   printf( "\n=== [QueryConditionSubscriber] Ready..." );

   do
   {
      g_status = StockMarket_StockDataReader_take_w_condition(QueryConditionDataDataReader,
               msgList,
               infoSeq,
               DDS_LENGTH_UNLIMITED,
               queryCondition);
      checkStatus(g_status, "StockMarket_StockDataReaderView_take");
      if( msgList->_length > 0 )
      {
         j = 0;
         do
         {
            QueryConditionDataSample = &msgList->_buffer[j];
            // When is this supposed to happen?
            // Needs comment...
            if( infoSeq->_buffer[j].valid_data )
            {
               printf("\n\n %s: %f", QueryConditionDataSample->ticker, QueryConditionDataSample->price);
               if( QueryConditionDataSample->price == (DDS_float) -1.0f )
               {
                  printf("\n ===[QueryConditionSubscriber] QueryConditionDataSample->price == -1.0f ");
                  isClosed = TRUE;
               }
            }
         }
         while( ++j < msgList->_length );

         g_status = StockMarket_StockDataReader_return_loan(QueryConditionDataDataReader, msgList, infoSeq);
         checkStatus(g_status, "StockMarket_StockDataReaderView_return_loan");
      }
      os_nanoSleep(delay_200ms);
      ++count;
   }
   while( isClosed == FALSE && count < 1500 );

   printf("\n\n=== [QueryConditionSubscriber] Market Closed");

   // Cleanup DDS from the created Entities.

   deleteQueryCondition(QueryConditionDataDataReader, queryCondition);
   deleteDataReader(QueryConditionDataSubscriber, QueryConditionDataDataReader);
   deleteSubscriber(QueryConditionDataSubscriber);
   deleteTopic(g_StockTopic);
   deleteParticipant();

   // Cleanup C allocations,
   // recursively freeing the allocated structures and sequences using the OpenSplice API.
   DDS_free(msgList);
   DDS_free(infoSeq);
//.........这里部分代码省略.........
开发者ID:S73417H,项目名称:opensplice,代码行数:101,代码来源:QueryConditionDataSubscriber.c

示例11: deleteTopic

void deleteTopic(DDS_Topic topic)
{
    g_status = DDS_DomainParticipant_delete_topic(g_domainParticipant, topic);
    checkStatus(g_status, "DDS_DomainParticipant_delete_topic");
}
开发者ID:xrl,项目名称:opensplice_dds,代码行数:5,代码来源:DDSEntitiesManager.c

示例12: main

int main(int argc, char *argv[])
{
   DDS_sequence_HelloWorldData_Msg* message_seq = DDS_sequence_HelloWorldData_Msg__alloc();
   DDS_SampleInfoSeq* message_infoSeq = DDS_SampleInfoSeq__alloc();
   DDS_Subscriber message_Subscriber;
   DDS_DataReader message_DataReader;
   c_bool isClosed = FALSE;
   int count = 0;
   os_time os_delay200 = { 0, 200000000 };

   // Create DDS DomainParticipant
   createParticipant("HelloWorld example");

   // Register the Topic's type in the DDS Domain.
   g_MessageTypeSupport = HelloWorldData_MsgTypeSupport__alloc();
   checkHandle(g_MessageTypeSupport, "HelloWorldData_MsgTypeSupport__alloc");
   registerMessageType(g_MessageTypeSupport);
   // Create the Topic's in the DDS Domain.
   g_MessageTypeName = (char*) HelloWorldData_MsgTypeSupport_get_type_name(g_MessageTypeSupport);
   g_MessageTopic = createTopic("HelloWorldData_Msg", g_MessageTypeName);
   DDS_free(g_MessageTypeName);
   DDS_free(g_MessageTypeSupport);

   // Create the Subscriber's in the DDS Domain.
   message_Subscriber = createSubscriber("HelloWorld");

   // Request a Reader from the the Subscriber.
   message_DataReader = createDataReader(message_Subscriber, g_MessageTopic);

   printf("\n=== [Subscriber] Ready ...");

   do
   {
      g_status = HelloWorldData_MsgDataReader_take(
          message_DataReader,
          message_seq,
          message_infoSeq,
          1,
          DDS_ANY_SAMPLE_STATE,
          DDS_ANY_VIEW_STATE,
          DDS_ANY_INSTANCE_STATE );
      checkStatus(g_status, "HelloWorldData_MsgDataReader_take");

      if( message_seq->_length > 0 && message_infoSeq->_buffer[0].valid_data )
      {
         isClosed = TRUE;
         printf("\n=== [Subscriber] message received :" );
         printf( "\n    userID  : %d", message_seq->_buffer[0].userID );
         printf( "\n    Message : \"%s\"\n", message_seq->_buffer[0].message );
         HelloWorldData_MsgDataReader_return_loan (message_DataReader, message_seq, message_infoSeq);
      }

      if(isClosed == FALSE)
      {
         os_nanoSleep(os_delay200);
         ++count;
      }
   }
   while( isClosed == FALSE && count < 1500 );

   os_nanoSleep(os_delay200);

   // Cleanup DDS from the created Entities.
   deleteDataReader(message_Subscriber, message_DataReader);
   deleteSubscriber(message_Subscriber);
   deleteTopic(g_MessageTopic);
   deleteParticipant();


   // Cleanup C allocations
   // Recursively free the instances sequence using the OpenSplice API.
   DDS_free(message_seq);
   DDS_free(message_infoSeq);

   return 0;
}
开发者ID:xrl,项目名称:opensplice_dds,代码行数:76,代码来源:HelloWorldDataSubscriber.c

示例13: clear


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

	GLint previousFboId = 0;

	// note that we are using a glGetInteger method here, which may stall the pipeline.
	// in the allocate() method, this is not that tragic since this will not be called 
	// within the draw() loop. Here, we need not optimise for performance, but for 
	// simplicity and readability .

	glGetIntegerv(GL_FRAMEBUFFER_BINDING, &previousFboId);
	glBindFramebuffer(GL_FRAMEBUFFER, fbo);

	//- USE REGULAR RENDER BUFFER
	if(!_settings.depthStencilAsTexture){
		if(_settings.useDepth && _settings.useStencil){
			stencilBuffer = depthBuffer = createAndAttachRenderbuffer(_settings.depthStencilInternalFormat, depthAttachment);
			retainRB(stencilBuffer);
			retainRB(depthBuffer);
		}else if(_settings.useDepth){
			depthBuffer = createAndAttachRenderbuffer(_settings.depthStencilInternalFormat, depthAttachment);
			retainRB(depthBuffer);
		}else if(_settings.useStencil){
			stencilBuffer = createAndAttachRenderbuffer(_settings.depthStencilInternalFormat, depthAttachment);
			retainRB(stencilBuffer);
		}
	//- INSTEAD USE TEXTURE
	}else{
		if(_settings.useDepth || _settings.useStencil){
			createAndAttachDepthStencilTexture(_settings.textureTarget,_settings.depthStencilInternalFormat,depthAttachment);
			#ifdef TARGET_OPENGLES
				// if there's depth and stencil the texture should be attached as
				// depth and stencil attachments
				// http://www.khronos.org/registry/gles/extensions/OES/OES_packed_depth_stencil.txt
				if(_settings.useDepth && _settings.useStencil){
					glFramebufferTexture2D(GL_FRAMEBUFFER,
										   GL_STENCIL_ATTACHMENT,
										   GL_TEXTURE_2D, depthBufferTex.texData.textureID, 0);
				}
			#endif
		}
	}
    
    settings.useDepth = _settings.useDepth;
    settings.useStencil = _settings.useStencil;
    settings.depthStencilInternalFormat = _settings.depthStencilInternalFormat;
    settings.depthStencilAsTexture = _settings.depthStencilAsTexture;
    settings.textureTarget = _settings.textureTarget;
    settings.wrapModeHorizontal = _settings.wrapModeHorizontal;
    settings.wrapModeVertical = _settings.wrapModeVertical;
    settings.maxFilter = _settings.maxFilter;
    settings.minFilter = _settings.minFilter;

	// if we want MSAA, create a new fbo for textures
	#ifndef TARGET_OPENGLES
		if(_settings.numSamples){
			glGenFramebuffers(1, &fboTextures);
			retainFB(fboTextures);
		}else{
			fboTextures = fbo;
		}
	#else
		fboTextures = fbo;
		if(_settings.numSamples){
			ofLogWarning("ofFbo") << "allocate(): multisampling not supported in OpenGL ES";
		}
	#endif

	// now create all textures and color buffers
	if(_settings.colorFormats.size() > 0) {
		for(int i=0; i<(int)_settings.colorFormats.size(); i++) createAndAttachTexture(_settings.colorFormats[i], i);
	} else if(_settings.numColorbuffers > 0) {
		for(int i=0; i<_settings.numColorbuffers; i++) createAndAttachTexture(_settings.internalformat, i);
		_settings.colorFormats = settings.colorFormats;
	} else {
		ofLogWarning("ofFbo") << "allocate(): no color buffers specified for frame buffer object " << fbo;
	}
	settings.internalformat = _settings.internalformat;
	
	dirty.resize(_settings.colorFormats.size(), true); // we start with all color buffers dirty.

	// if textures are attached to a different fbo (e.g. if using MSAA) check it's status
	if(fbo != fboTextures) {
		glBindFramebuffer(GL_FRAMEBUFFER, fboTextures);
	}

	// check everything is ok with this fbo
	bIsAllocated = checkStatus();

	// restore previous framebuffer id
	glBindFramebuffer(GL_FRAMEBUFFER, previousFboId);

    /* UNCOMMENT OUTSIDE OF DOING RELEASES
	
    // this should never happen
	if(settings != _settings) ofLogWarning("ofFbo") << "allocation not complete, passed settings not equal to created ones, this is an internal OF bug";
    
    */
#ifdef TARGET_ANDROID
	ofAddListener(ofxAndroidEvents().reloadGL,this,&ofFbo::reloadFbo);
#endif
}
开发者ID:jvcleave,项目名称:compare,代码行数:101,代码来源:ofFbo.cpp

示例14: PluginMessageEventHook

// 'Pings' the FlashThread to keep the LEDs flashing.
static int PluginMessageEventHook(WPARAM hContact, LPARAM lParam)
{
	HANDLE hEvent = (HANDLE)lParam;

	//get DBEVENTINFO without pBlob
	DBEVENTINFO einfo = { sizeof(einfo) };
	if (!db_event_get(hEvent, &einfo) && !(einfo.flags & DBEF_SENT))
		if ((einfo.eventType == EVENTTYPE_MESSAGE && bFlashOnMsg && checkOpenWindow(hContact) && checkMsgTimestamp(hContact, hEvent, einfo.timestamp)) ||
		    (einfo.eventType == EVENTTYPE_URL     && bFlashOnURL)  ||
		    (einfo.eventType == EVENTTYPE_FILE    && bFlashOnFile) ||
		    (einfo.eventType != EVENTTYPE_MESSAGE && einfo.eventType != EVENTTYPE_URL && einfo.eventType != EVENTTYPE_FILE && bFlashOnOther)) {

			if (contactCheckProtocol(einfo.szModule, hContact, einfo.eventType) && checkNotifyOptions() && checkStatus(einfo.szModule) && checkXstatus(einfo.szModule))

				SetEvent(hFlashEvent);
		}

	return 0;
}
开发者ID:0xmono,项目名称:miranda-ng,代码行数:20,代码来源:main.cpp

示例15: ReminderTimer

static VOID CALLBACK ReminderTimer(HWND hwnd, UINT message, UINT_PTR idEvent, DWORD dwTime)
{
	int nIndex;
	CLISTEVENT *pCLEvent;

	if (!bReminderDisabled && nExternCount && bFlashOnOther) {
		SetEvent(hFlashEvent);
		return;
	}

	for (nIndex = 0; !bReminderDisabled && (pCLEvent = (CLISTEVENT*)CallService(MS_CLIST_GETEVENT, -1, nIndex)); nIndex++) {
		DBEVENTINFO einfo = readEventInfo(pCLEvent->hDbEvent, pCLEvent->hContact);

		if ((einfo.eventType == EVENTTYPE_MESSAGE && bFlashOnMsg)  ||
		    (einfo.eventType == EVENTTYPE_URL     && bFlashOnURL)  ||
		    (einfo.eventType == EVENTTYPE_FILE    && bFlashOnFile) ||
		    (einfo.eventType != EVENTTYPE_MESSAGE && einfo.eventType != EVENTTYPE_URL && einfo.eventType != EVENTTYPE_FILE && bFlashOnOther))

			if (metaCheckProtocol(einfo.szModule, pCLEvent->hContact, einfo.eventType) && checkNotifyOptions() && checkStatus(einfo.szModule) && checkXstatus(einfo.szModule)) {

				SetEvent(hFlashEvent);
				return;
			}
	}

}
开发者ID:0xmono,项目名称:miranda-ng,代码行数:26,代码来源:main.cpp


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