OpenDDS::DCPS::FreeIndexNode Class Reference

#include <MemoryPool.h>

Collaboration diagram for OpenDDS::DCPS::FreeIndexNode:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 FreeIndexNode ()
void set_ptr (FreeHeader *ptr)
void set_sizes (size_t size, size_t limit)
bool contains (size_t size)
FreeHeaderptr ()
unsigned int size () const

Private Attributes

size_t size_
 size of buffer
size_t limit_
 upper_limit of buffer size (one too large)
FreeHeaderptr_
 points to smallest free alloc of size_ or larger

Detailed Description

Node of free index. Should point to smallest free block of the range from size (inclusive) to limit (non inclusive). If multiple free allocations of the smallest size in range exist, should point to the one which is the "smallest" (in free list order).

Definition at line 91 of file MemoryPool.h.


Constructor & Destructor Documentation

OpenDDS::DCPS::FreeIndexNode::FreeIndexNode (  ) 

Definition at line 145 of file MemoryPool.cpp.

00146 : size_(0)
00147 , limit_(0)
00148 , ptr_(0)
00149 {
00150 }


Member Function Documentation

bool OpenDDS::DCPS::FreeIndexNode::contains ( size_t  size  )  [inline]

Does this node contain a given size

Definition at line 100 of file MemoryPool.h.

References limit_, and size_.

00100 { return ((size >= size_) && (size < limit_)); }

FreeHeader* OpenDDS::DCPS::FreeIndexNode::ptr (  )  [inline]

Get this node's free block

Definition at line 103 of file MemoryPool.h.

References ptr_.

Referenced by OpenDDS::DCPS::FreeIndex::find(), and set_ptr().

00103 { return ptr_; }

void OpenDDS::DCPS::FreeIndexNode::set_ptr ( FreeHeader ptr  )  [inline]

Set the free alloc this node points to

Definition at line 95 of file MemoryPool.h.

References ptr(), and ptr_.

Referenced by OpenDDS::DCPS::FreeIndex::add(), and OpenDDS::DCPS::FreeIndex::remove().

00095 { ptr_ = ptr; }

void OpenDDS::DCPS::FreeIndexNode::set_sizes ( size_t  size,
size_t  limit 
)

Set the sizes for this node

Definition at line 153 of file MemoryPool.cpp.

References limit_, and size_.

00154 {
00155   size_ = size;
00156   limit_ = limit;
00157 }

unsigned int OpenDDS::DCPS::FreeIndexNode::size (  )  const [inline]

Get this node's minimum size

Definition at line 105 of file MemoryPool.h.

References size_.

00105 { return static_cast<unsigned int>(size_); }


Member Data Documentation

size_t OpenDDS::DCPS::FreeIndexNode::limit_ [private]

upper_limit of buffer size (one too large)

Definition at line 109 of file MemoryPool.h.

Referenced by contains(), and set_sizes().

FreeHeader* OpenDDS::DCPS::FreeIndexNode::ptr_ [private]

points to smallest free alloc of size_ or larger

Definition at line 110 of file MemoryPool.h.

Referenced by ptr(), and set_ptr().

size_t OpenDDS::DCPS::FreeIndexNode::size_ [private]

size of buffer

Definition at line 108 of file MemoryPool.h.

Referenced by contains(), set_sizes(), and size().


The documentation for this class was generated from the following files:
Generated on Fri Feb 12 20:06:19 2016 for OpenDDS by  doxygen 1.4.7