Changes between Version 15 and Version 16 of ariba_0_9


Ignore:
Timestamp:
Jun 21, 2013, 2:47:09 PM (11 years ago)
Author:
hock@…
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ariba_0_9

    v15 v16  
    153153
    154154Typical operations:
    155   - reboost::message_t msg;  // creates an empty message
     155  - reboost::message_t msg;
     156    - creates an empty message
    156157  - void message_t::push_back(shared_buffer_t)
    157158  - void message_t::push_front(shared_buffer_t)
     
    159160  - size_t message_t::size()
    160161
    161 For more information refer to the source code: ariba/utility/transport/messages/message.hpp
     162For more information refer to the source code: `ariba/utility/transport/messages/message.hpp`
    162163
    163164''' reboost::shared_buffer_t '''
     165
     166A simple shared buffer.
     167
     168Important: if not shared, a buffer is writable. After the buffer is shared, the buffer is immutable. It uses shared_ptr/default allocators and prints error messages to `cerr` if buffers leaked at the end of the program (only in `debug` mode).
     169
     170Typical operations:
     171
     172  - shared_buffer_t(size_t size)
     173    - creates a shared buffer of a specific size
     174    - allocates memory and frees after destruction
     175  - shared_buffer_t(unsigned char* buffer, size_t size)
     176    - creates a shared buffer from existing data
     177    - transfers ownership
     178    - frees memory after destruction
     179  - shared_buffer_t shared_buffer_t::operator()(size_t index, size_t size = 0)
     180    - return sub-buffer
     181    - example: `shared_buffer_t sub_buff = buff(15)`;
     182  - const uint8_t* data = buff.data();
     183    - access data as array (read-only)
     184  - uint8_t* data = buff.mutable_data();
     185    - access data as array (writable)
     186    - NOTE: only if buffer is not shared, yet
     187
     188For more information refer to the source code: `ariba/utility/transport/messages/shared_buffer.hpp`