Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

osg::DrawTreeNodeFactory Class Reference
[Rendering Backend]

#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 55 of file OSGDrawTreeNodeFactory.h.


Member Typedef Documentation

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

Definition at line 100 of file OSGDrawTreeNodeFactory.h.

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

Definition at line 102 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

* DrawTreeNodeStore osg::DrawTreeNodeFactory::_nodeStore [protected]
 

Definition at line 109 of file OSGDrawTreeNodeFactory.h.

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

DrawTreeNodeStoreIt osg::DrawTreeNodeFactory::_currentFreeNode [protected]
 

Definition at line 110 of file OSGDrawTreeNodeFactory.h.

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

UInt32 osg::DrawTreeNodeFactory::_uiAllocated [protected]
 

Definition at line 112 of file OSGDrawTreeNodeFactory.h.

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

UInt32 osg::DrawTreeNodeFactory::_uiReused [protected]
 

Definition at line 113 of file OSGDrawTreeNodeFactory.h.

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


The documentation for this class was generated from the following files:
Generated on Thu Aug 25 04:19:04 2005 for OpenSG by  doxygen 1.4.3