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 93 of file MemoryPool.h.


Constructor & Destructor Documentation

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

Definition at line 147 of file MemoryPool.cpp.

00148 : size_(0)
00149 , limit_(0)
00150 , ptr_(0)
00151 {
00152 }


Member Function Documentation

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

Does this node contain a given size

Definition at line 102 of file MemoryPool.h.

References limit_, and size_.

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

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

Get this node's free block

Definition at line 105 of file MemoryPool.h.

References ptr_.

Referenced by OpenDDS::DCPS::FreeIndex::find().

00105 { return ptr_; }

Here is the caller graph for this function:

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

Set the free alloc this node points to

Definition at line 97 of file MemoryPool.h.

References ptr_.

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

00097 { ptr_ = ptr; }

Here is the caller graph for this function:

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

Set the sizes for this node

Definition at line 155 of file MemoryPool.cpp.

References limit_, and size_.

Referenced by OpenDDS::DCPS::FreeIndex::init().

00156 {
00157   size_ = size;
00158   limit_ = limit;
00159 }

Here is the caller graph for this function:

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

Get this node's minimum size

Definition at line 107 of file MemoryPool.h.

References size_.

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


Member Data Documentation

upper_limit of buffer size (one too large)

Definition at line 111 of file MemoryPool.h.

Referenced by contains(), and set_sizes().

points to smallest free alloc of size_ or larger

Definition at line 112 of file MemoryPool.h.

Referenced by ptr(), and set_ptr().

size of buffer

Definition at line 110 of file MemoryPool.h.

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


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 10 Aug 2018 for OpenDDS by  doxygen 1.6.1