Coin Logo http://www.sim.no
http://www.coin3d.org

Public Member Functions | List of all members
SbStorage Class Reference

The SbStorage class manages thread-local memory.This class manages thread-local memory. When different threads access the memory an SbStorage object manages, they will receive different memory blocks back. More...

#include <Inventor/threads/SbStorage.h>

Public Member Functions

 SbStorage (unsigned int size)
 
 SbStorage (unsigned int size, void(*constr)(void *), void(*destr)(void *))
 
 ~SbStorage (void)
 
void * get (void)
 
void applyToAll (SbStorageApplyFunc *func, void *closure)
 

Detailed Description

The SbStorage class manages thread-local memory.

This class manages thread-local memory. When different threads access the memory an SbStorage object manages, they will receive different memory blocks back.

This provides a mechanism for sharing read/write static data.

One important implementation detail: if the Coin library was explicitly configured to be built without multi-platform thread abstractions, or neither pthreads nor native Win32 thread functions are available, it will be assumed that the client code will all run in the same thread. This means that the same memory block will be returned for any request without considering the current thread id.

Constructor & Destructor Documentation

◆ SbStorage() [1/2]

SbStorage::SbStorage ( unsigned int  size)
inline

Constructor. size specifies the number of bytes each thread should have in this thread-local memory management object.

◆ SbStorage() [2/2]

SbStorage::SbStorage ( unsigned int  size,
void(*)(void *)  constr,
void(*)(void *)  destr 
)
inline

Constructor. size specifies the number of bytes each thread should have in this thread-local memory management object. A constructor and a destructor functions can be given that will be called when the actual memory blocks are allocated and freed.

◆ ~SbStorage()

SbStorage::~SbStorage ( void  )
inline

The destructor.

Member Function Documentation

◆ get()

void * SbStorage::get ( void  )
inline

◆ applyToAll()

void SbStorage::applyToAll ( SbStorageApplyFunc *  func,
void *  closure 
)
inline

This method will call func for all thread local storage data. closure will be supplied as the second parameter to the callback.


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

Copyright © 1998-2007 by Systems in Motion AS. All rights reserved.

Generated on Fri Feb 17 2017 for Coin by Doxygen. 1.8.13