packages/Utils/utils/Packing_Utils.i.hh
//---------------------------------------------------------------------------//
// INLINE AND TEMPLATE MEMBERS FOR UNPACKER
//---------------------------------------------------------------------------//
/*!
 * \brief Set an allocated buffer to read data from.
 *
 * This function accepts an allocated char* buffer.  It assigns begin and end
 * pointers and a mutable position pointer that acts like an iterator.  The
 * Unpacker will read POD data from this buffer starting at the beginning
 * address of the buffer.  This function must be called before any
 * Unpacker::unpack() calls can be made.
 *
 * Once Unpacker::set_buffer() is called, all subsequent calls to
 * Unpacker::unpack() will read data incrementally from the buffer set by
 * set_buffer().  To read data from a different buffer, call
 * Unpacker::set_buffer() again; at this point the Unpacker no longer has any
 * knowledge about the old buffer.
 *
 * Note, there is no memory allocation performed by the Unpacker class.  Also,
 * the client must know how much data to read from the stream (of course
 * checks can be made telling where the end of the stream is located using
 * the Unpacker::get_ptr(), Unpacker::begin(), and Unpacker::end() functions).
 *
 * \param size_in size of the buffer
 * \param buffer  const_pointer to the char * buffer
 *
 */


This function accepts an allocated char* buffer.  It assigns begin and end
pointers and a mutable position pointer that acts like an iterator.  The
Unpacker will read POD data from this buffer starting at the beginning
address of the buffer.  This function must be called before any
Unpacker::unpack() calls can be made.

Once Unpacker::set_buffer() is called, all subsequent calls to
Unpacker::unpack() will read data incrementally from the buffer set by
set_buffer().  To read data from a different buffer, call
Unpacker::set_buffer() again; at this point the Unpacker no longer has any
knowledge about the old buffer.

Note, there is no memory allocation performed by the Unpacker class.

\param size_in size of the buffer
\param buffer  const_pointer to the char * buffer
This function accepts an allocated char * buffer . It assigns begin and end pointers and a mutable position pointer that acts like an iterator . The Unpacker will read POD data from this buffer starting at the beginning address of the buffer . This function must be called before any Unpacker :: unpack () calls can be made . Once Unpacker :: set_buffer () is called all subsequent calls to Unpacker :: unpack () will read data incrementally from the buffer set by set_buffer () . To read data from a different buffer call Unpacker :: set_buffer () again ; at this point the Unpacker no longer has any knowledge about the old buffer . Note there is no memory allocation performed by the Unpacker class . \ param size_in size of the buffer \ param buffer const_pointer to the char * buffer
void Unpacker::set_buffer(unsigned int size_in, const_pointer buffer)
{
    REQUIRE(buffer);
    stream_size  = size_in;
    ptr          = &buffer[0];
    begin_ptr    = &buffer[0];
    end_ptr      = begin_ptr + stream_size;
}
void Unpacker :: set_buffer ( unsigned int size_in , const_pointer buffer ) { REQUIRE ( buffer ) ; stream_size = size_in ; ptr = & buffer [ 0 ] ; begin_ptr = & buffer [ 0 ] ; end_ptr = begin_ptr + stream_size ; }
INLINE AND TEMPLATE MEMBERS FOR UNPACKER
 \brief Set an allocated buffer to read data from.
INLINE AND TEMPLATE MEMBERS FOR UNPACKER \ brief Set an allocated buffer to read data from .
// set the size, begin and end pointers, and iterator