Пример #1
0
STDMETHODIMP NATNetworkWrap::COMGETTER(EventSource)(IEventSource **aEventSource)
{
    LogRelFlow(("{%p} %s: enter aEventSource=%p\n", this, "NATNetwork::getEventSource", aEventSource));

    VirtualBoxBase::clearError();

    HRESULT hrc;

    try
    {
        CheckComArgOutPointerValidThrow(aEventSource);

        AutoCaller autoCaller(this);
        if (FAILED(autoCaller.rc()))
            throw autoCaller.rc();

        hrc = getEventSource(ComTypeOutConverter<IEventSource>(aEventSource).ptr());
    }
    catch (HRESULT hrc2)
    {
        hrc = hrc2;
    }
    catch (...)
    {
        hrc = VirtualBoxBase::handleUnexpectedExceptions(this, RT_SRC_POS);
    }

    LogRelFlow(("{%p} %s: leave *aEventSource=%p hrc=%Rhrc\n", this, "NATNetwork::getEventSource", *aEventSource, hrc));
    return hrc;
}
Пример #2
0
    void sample()
    {
        ::fivox::URI uri = getURI();

        // for compatibility
        if( _vm.count( "size" ))
            uri.addQuery( "size", std::to_string( _vm["size"].as< size_t >( )));

        const ::fivox::URIHandler params( uri );
        auto source = params.newImageSource< fivox::FloatVolume >();

        const fivox::Vector3f& extent( source->getSizeInMicrometer( ));
        const size_t size( std::ceil( source->getSizeInVoxel().find_max( )));

        const VolumeHandler volumeHandler( size, extent );
        VolumePtr output = source->GetOutput();

        output->SetRegions( volumeHandler.computeRegion( _decompose ));
        output->SetSpacing( volumeHandler.computeSpacing( ));
        const fivox::AABBf& bbox = source->getBoundingBox();
        output->SetOrigin( volumeHandler.computeOrigin( bbox.getCenter( )));

        ::fivox::EventSourcePtr loader = source->getEventSource();
        const fivox::Vector2ui frameRange( getFrameRange( loader->getDt( )));

        const std::string& datatype( _vm["datatype"].as< std::string >( ));
        if( datatype == "char" )
        {
            LBINFO << "Sampling volume as char (uint8_t) data" << std::endl;
            _sample< uint8_t >( source, frameRange, params, _outputFile );
        }
        else if( datatype == "short" )
        {
            LBINFO << "Sampling volume as short (uint16_t) data" << std::endl;
            _sample< uint16_t >( source, frameRange, params, _outputFile );
        }
        else if( datatype == "int" )
        {
            LBINFO << "Sampling volume as int (uint32_t) data" << std::endl;
            _sample< uint32_t >( source, frameRange, params, _outputFile );
        }
        else
        {
            LBINFO << "Sampling volume as floating point data" << std::endl;
            _sample< float >( source, frameRange, params, _outputFile );
        }
    }
Пример #3
0
 /**
     Returns the event source of the timer.
     @return the event source of the timer.
  */
 operator EventSource () const {
     return getEventSource();
 }
Пример #4
0
void PlayingField::emitLineCompleteEvent(int amountOfLines) {
	ALLEGRO_EVENT ev;
	ev.user.data1 = amountOfLines;
	ev.type = ALLEGRO_GET_EVENT_TYPE('l', 'i', 'n', 'e');
	al_emit_user_event(getEventSource(), &ev, 0);
}
Пример #5
0
void PlayingField::createEventSource(void) {
	al_init_user_event_source(getEventSource());
}
Пример #6
0
PlayingField::~PlayingField(void) {
	deleteBlockLines();
	al_destroy_user_event_source(getEventSource());
}