pelican/examples/reference/src/EmulatorExample.cpp
/**
 * @details
 * Creates a packet of real-valued double-precision data.
 * The values increase linearly by 1.0 each time this method is called.
 *
 * @param ptr[out]   Pointer to the start of the packet.
 * @param size[out]  Size of the packet.
 */
@details
Creates a packet of real-valued double-precision data.
The values increase linearly by 1.0 each time this method is called.

@param ptr[out]   Pointer to the start of the packet.
@param size[out]  Size of the packet.
@details Creates a packet of real - valued double - precision data . The values increase linearly by 1 . 0 each time this method is called . @param ptr [ out ] Pointer to the start of the packet . @param size [ out ] Size of the packet .
void EmulatorExample::getPacketData(char*& ptr, unsigned long& size)
{
    ptr = _packet.data();
    size = _packetSize;
    unsigned nDoubles = _packet.size() / sizeof(double);
    for (unsigned i = 0; i < nDoubles; ++i)
        reinterpret_cast<double*>(ptr)[i] = _initialValue + _counter;
    _counter++;
}
void EmulatorExample :: getPacketData ( char * & ptr , unsigned long & size ) { ptr = _packet . data ( ) ; size = _packetSize ; unsigned nDoubles = _packet . size ( ) / sizeof ( double ) ; for ( unsigned i = 0 ; i < nDoubles ; ++ i ) reinterpret_cast < double * > ( ptr ) [ i ] = _initialValue + _counter ; _counter ++ ; }
@details
 Creates a packet of real-valued double-precision data.
@details Creates a packet of real - valued double - precision data .
// Set the output data. // Fill the packet. // Increment counter for next time.