Changeset 4:56327e0243d3 in rrlib_buffer_pools


Ignore:
Timestamp:
03.01.2013 03:23:55 (6 years ago)
Author:
Max Reichardt <mreichardt@…>
Branch:
default
Phase:
public
Message:

Small enhancements and fixes

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • make.xml

    r0 r4  
    22<targets> 
    33 
    4   <rrlib name="buffer_pools_new"> 
     4  <rrlib name="buffer_pools"> 
    55    <sources> 
    66      *.h 
  • policies/recycling/UseOwnerStorageInBuffer.h

    r3 r4  
    7373class UseOwnerStorageInBuffer 
    7474{ 
    75   static_assert(std::is_base_of<tBufferManagementInfo, T>::value, "Type T must be subclass of tBufferManagementInfo for this policy."); 
    7675 
    7776//---------------------------------------------------------------------- 
     
    8584  void operator()(T* p) const 
    8685  { 
     86    static_assert(std::is_base_of<tBufferManagementInfo, T>::value, "Type T must be subclass of tBufferManagementInfo for this policy."); // static assertions are in methods to deal with incomplete types properly 
    8787    tBufferManagementInfo& info_storage = static_cast<tBufferManagementInfo&>(*p); 
    8888    TBufferManagementPolicy::RecycleBuffer(info_storage, p); 
     
    9191  static tPointer AddBuffer(TBufferManagementPolicy& buffer_management, std::unique_ptr<tManagedType> && buffer) 
    9292  { 
     93    static_assert(std::is_base_of<tBufferManagementInfo, T>::value, "Type T must be subclass of tBufferManagementInfo for this policy."); 
    9394    buffer_management.AddBuffer(buffer.get(), *buffer); 
    9495    return tPointer(buffer.release()); 
     
    9798  static tPointer GetUnusedBuffer(TBufferManagementPolicy& buffer_management) 
    9899  { 
     100    static_assert(std::is_base_of<tBufferManagementInfo, T>::value, "Type T must be subclass of tBufferManagementInfo for this policy."); 
    99101    tBufferManagementInfo info; 
    100102    return tPointer(buffer_management.GetUnusedBuffer(info)); 
  • tBufferPool.h

    r3 r4  
    108108class tBufferPool : boost::noncopyable 
    109109{ 
    110   typedef TBufferManagementPolicy<typename TRecycling<T, int>::tManagedType, CONCURRENCY, TBufferDeleter, TBufferManagementPolicyArgs...> tBufferManagement; 
    111   typedef TRecycling<T, tBufferManagement> tRecycler; 
    112  
    113110//---------------------------------------------------------------------- 
    114111// Public methods and typedefs 
    115112//---------------------------------------------------------------------- 
    116113public: 
     114 
     115  /*! Buffer management backend */ 
     116  typedef TBufferManagementPolicy<typename TRecycling<T, int>::tManagedType, CONCURRENCY, TBufferDeleter, TBufferManagementPolicyArgs...> tBufferManagement; 
     117 
     118  /*! Recycling policy */ 
     119  typedef TRecycling<T, tBufferManagement> tRecycler; 
    117120 
    118121  /*! 
     
    131134   */ 
    132135  typedef typename TRecycling<T, int>::tManagedType tManagedType; 
     136 
    133137 
    134138  tBufferPool() : 
Note: See TracChangeset for help on using the changeset viewer.