コード例 #1
0
/////////////////////////////////////
// Declaration Management Services //
/////////////////////////////////////
// 5.2
void RTI::RTIambassador::publishObjectClass( RTI::ObjectClassHandle theClass,
        const RTI::AttributeHandleSet& attributeList )
throw( RTI::ObjectClassNotDefined,
       RTI::AttributeNotDefined,
       RTI::OwnershipAcquisitionPending,
       RTI::FederateNotExecutionMember,
       RTI::ConcurrentAccessAttempted,
       RTI::SaveInProgress,
       RTI::RestoreInProgress,
       RTI::RTIinternalError )
{
    if( logger->isTraceEnabled() )
    {
        char* theAttributeList = setToString( attributeList );
        logger->trace( "[Starting] publishObjectClass(): classHandle=%d, attributes=%s",
                       theClass, theAttributeList );
        delete theAttributeList;
    }

    // get java versions of the parameters
    jintArray jAttSet = privateRefs->rti->convertAHS( attributeList );

    // call the method
    privateRefs->env->CallVoidMethod( privateRefs->rti->jproxy,
                                      privateRefs->rti->PUBLISH_OBJECT_CLASS,
                                      theClass,
                                      jAttSet );

    // clean up and run the exception check
    privateRefs->env->DeleteLocalRef( jAttSet );
    privateRefs->rti->exceptionCheck();

    logger->debug( "[Finished] publishObjectClass(): objectClass=%d", theClass );
}
コード例 #2
0
// 5.6
void RTI::RTIambassador::subscribeObjectClassAttributes( RTI::ObjectClassHandle theClass,
        const RTI::AttributeHandleSet& attributes,
        RTI::Boolean active )
throw( RTI::ObjectClassNotDefined,
       RTI::AttributeNotDefined,
       RTI::FederateNotExecutionMember,
       RTI::ConcurrentAccessAttempted,
       RTI::SaveInProgress,
       RTI::RestoreInProgress,
       RTI::RTIinternalError )
{
    /////////////////////
    // log the request //
    /////////////////////
    if( logger->isTraceEnabled() )
    {
        char* attributeList = setToString( attributes );
        if( active == RTI:: RTI_TRUE )
        {
            logger->trace( "[Starting] subscribeObjectClassAttributes(active): classHandle=%d, attributes=%s",
                           theClass, attributeList );
        }
        else
        {
            logger->trace( "[Starting] subscribeObjectClassAttributes(passive): classHandle=%d, attributes=%s",
                           theClass, attributeList );
        }
        delete attributeList;
    }

    /////////////////////////
    // do the subscription //
    /////////////////////////
    // get java versions of the parameters
    jintArray jAttSet = privateRefs->rti->convertAHS( attributes );

    if( active == RTI::RTI_TRUE )
    {
        // call the method
        privateRefs->env->CallVoidMethod( privateRefs->rti->jproxy,
                                          privateRefs->rti->SUBSCRIBE_OBJECT_CLASS_ATTRIBUTES_ACTIVELY,
                                          theClass,
                                          jAttSet );
    }
    else
    {
        // call the method
        privateRefs->env->CallVoidMethod( privateRefs->rti->jproxy,
                                          privateRefs->rti->SUBSCRIBE_OBJECT_CLASS_ATTRIBUTES_PASSIVELY,
                                          theClass,
                                          jAttSet );
    }

    // clean up and run the exception check
    privateRefs->env->DeleteLocalRef( jAttSet );
    privateRefs->rti->exceptionCheck();

    logger->debug( "[Finished] subscribeObjectClassAttributes(): classHandle=%d", theClass );
}
コード例 #3
0
ファイル: Game.cpp プロジェクト: JesperMikkelsen/Big-Numbers
String MoveWithResult::toString() const {
  return format(_T("{%-5s}:%s"), setToString(*m_move).cstr(), statusToString(m_status).cstr());
}
コード例 #4
0
ファイル: DataKey.cpp プロジェクト: Andy-Amoy/mr4c
		std::string str() const {
			return setToString(m_elements, ",");
		}
コード例 #5
0
ファイル: Color.hpp プロジェクト: etschneider/GPSTk
 /**
  * Color initialized using a single string. 
  * \see Color::setToString for a list of valid strings. 
  * @param colorName String description of what this color should end up
  * as.
  */
 Color(const std::string& colorName) { setToString(colorName); };