src/misc/blob.hpp
branchNewGRF_ports
changeset 10994 cd9968b6f96b
parent 10724 68a692eacf22
equal deleted inserted replaced
10991:d8811e327d12 10994:cd9968b6f96b
     4 
     4 
     5 #ifndef BLOB_HPP
     5 #ifndef BLOB_HPP
     6 #define BLOB_HPP
     6 #define BLOB_HPP
     7 
     7 
     8 #include "../core/alloc_func.hpp"
     8 #include "../core/alloc_func.hpp"
     9 
     9 #include "../core/mem_func.hpp"
    10 /** Type-safe version of memcpy().
       
    11  * @param d destination buffer
       
    12  * @param s source buffer
       
    13  * @param num_items number of items to be copied (!not number of bytes!) */
       
    14 template <class Titem_>
       
    15 FORCEINLINE void MemCpyT(Titem_* d, const Titem_* s, int num_items = 1)
       
    16 {
       
    17 	memcpy(d, s, num_items * sizeof(Titem_));
       
    18 }
       
    19 
    10 
    20 /** Base class for simple binary blobs.
    11 /** Base class for simple binary blobs.
    21 *  Item is byte.
    12 *  Item is byte.
    22 *  The word 'simple' means:
    13 *  The word 'simple' means:
    23 *    - no configurable allocator type (always made from heap)
    14 *    - no configurable allocator type (always made from heap)