OSG::DrawTreeNodeFactory Class Reference

#include <OSGDrawTreeNodeFactory.h>

List of all members.


Public Member Functions

Constructors


 DrawTreeNodeFactory (void)
Destructor


virtual ~DrawTreeNodeFactory (void)
create


DrawTreeNodecreate (void)
free


void freeAll (void)
stat


void printStat (void)

Protected Types

typedef std::vector< DrawTreeNode * > DrawTreeNodeStore
typedef std::vector< DrawTreeNode
* >::iterator 
DrawTreeNodeStoreIt

Protected Attributes

Member


DrawTreeNodeStore _nodeStore
DrawTreeNodeStoreIt _currentFreeNode
UInt32 _uiAllocated
UInt32 _uiReused

Private Member Functions

 DrawTreeNodeFactory (const DrawTreeNodeFactory &source)
 prohibit default function (move to 'public' if needed)
void operator= (const DrawTreeNodeFactory &source)
 prohibit default function (move to 'public' if needed)

Detailed Description

Definition at line 56 of file OSGDrawTreeNodeFactory.h.


Member Typedef Documentation

typedef std::vector<DrawTreeNode *> OSG::DrawTreeNodeFactory::DrawTreeNodeStore [protected]

Definition at line 101 of file OSGDrawTreeNodeFactory.h.

typedef std::vector<DrawTreeNode *>::iterator OSG::DrawTreeNodeFactory::DrawTreeNodeStoreIt [protected]

Definition at line 103 of file OSGDrawTreeNodeFactory.h.


Constructor & Destructor Documentation

DrawTreeNodeFactory::DrawTreeNodeFactory ( void   ) 

Definition at line 55 of file OSGDrawTreeNodeFactory.cpp.

References _currentFreeNode, and _nodeStore.

00055                                              :
00056     _nodeStore      ( ),
00057     _currentFreeNode( ),
00058     _uiAllocated    (0),
00059     _uiReused       (0)
00060 {
00061     _currentFreeNode = _nodeStore.end();
00062 }

DrawTreeNodeFactory::~DrawTreeNodeFactory ( void   )  [virtual]

Definition at line 67 of file OSGDrawTreeNodeFactory.cpp.

References _nodeStore.

00068 {
00069     for(UInt32 i = 0; i < _nodeStore.size(); ++i)
00070     {
00071         delete _nodeStore[i];
00072     }
00073 }

OSG::DrawTreeNodeFactory::DrawTreeNodeFactory ( const DrawTreeNodeFactory source  )  [private]


Member Function Documentation

DrawTreeNode * OSG::DrawTreeNodeFactory::create ( void   )  [inline]

Definition at line 42 of file OSGDrawTreeNodeFactory.inl.

References _currentFreeNode, _nodeStore, _uiAllocated, _uiReused, and OSG::DrawTreeNode::reset().

Referenced by OSG::RenderAction::dropFunctor(), and OSG::RenderAction::dropGeometry().

00043 {
00044     DrawTreeNode *returnValue = NULL;
00045 
00046     if(_currentFreeNode != _nodeStore.end())
00047     {
00048         returnValue = *_currentFreeNode;
00049 
00050         ++_currentFreeNode;
00051 
00052         returnValue->reset();
00053 
00054         ++_uiReused;
00055     }
00056     else
00057     {
00058         returnValue = new DrawTreeNode();
00059 
00060         _nodeStore.push_back(returnValue);
00061 
00062         _currentFreeNode = _nodeStore.end();
00063 
00064         ++_uiAllocated;
00065     }
00066     
00067     return returnValue;
00068 }

void OSG::DrawTreeNodeFactory::freeAll ( void   )  [inline]

Definition at line 71 of file OSGDrawTreeNodeFactory.inl.

References _currentFreeNode, _nodeStore, _uiAllocated, and _uiReused.

Referenced by OSG::RenderAction::start().

00072 {
00073     _currentFreeNode = _nodeStore.begin();
00074 
00075     _uiAllocated = 0;
00076     _uiReused    = 0;
00077 }

void DrawTreeNodeFactory::printStat ( void   ) 

Definition at line 75 of file OSGDrawTreeNodeFactory.cpp.

References _nodeStore, _uiAllocated, and _uiReused.

00076 {
00077     fprintf(stderr, "\n%d | %d | %d\n", 
00078             _uiAllocated, 
00079             _uiReused, 
00080             _nodeStore.size());
00081 }

void OSG::DrawTreeNodeFactory::operator= ( const DrawTreeNodeFactory source  )  [private]


Member Data Documentation

Definition at line 111 of file OSGDrawTreeNodeFactory.h.

Referenced by create(), DrawTreeNodeFactory(), and freeAll().

Definition at line 113 of file OSGDrawTreeNodeFactory.h.

Referenced by create(), freeAll(), and printStat().

Definition at line 114 of file OSGDrawTreeNodeFactory.h.

Referenced by create(), freeAll(), and printStat().


The documentation for this class was generated from the following files: