Starting from 2021-07-01, all LRZ GitLab users will be required to explicitly accept the GitLab Terms of Service. Please see the detailed information at and make sure that your projects conform to the requirements.

Commit f8cddf01 authored by schultezub's avatar schultezub
Browse files

fixed DataContainerInspectorCanvas

updated some documentation

git-svn-id: bb408c1c-ae56-11e1-83d9-df6b3e0c105e
parent d9ae79b6
......@@ -99,7 +99,9 @@ namespace TUMVis {
tbb::mutex::scoped_lock lock(_localMutex);
_handles = _dataContainer->getHandlesCopy();
_dataContainer = dataContainer;
if (_dataContainer != 0)
_handles = _dataContainer->getHandlesCopy();
if (_dataContainer != 0) {
......@@ -52,9 +52,6 @@ namespace TUMVis {
* some brain fuck.
* \todo Check thread-safety
* \todo If the original data changes, the other objects accessing that very DataHandle might want to
* get notified of the change. Hence, some observer pattern might be useful.
class DataContainer {
......@@ -135,7 +132,7 @@ namespace TUMVis {
* \param name Key for accessing the DataHandle within this DataContainer
* \param data DataHandle to add.
* \return The DataHandle which was created for \a data.
* \return A DataHandle containing \a data.
DataHandle addData(const std::string& name, AbstractData* data);
......@@ -158,10 +155,10 @@ namespace TUMVis {
* Returns the DataHandle with the given name from this container.
* If no such DataHandle exists, this method returns 0.
* If no such DataHandle exists, this method returns an empty DataHandle.
* \param name Key of the DataHandle to search for
* \return The stored DataHandle with the given name, 0 if no such DataHandle exists.
* \return The stored DataHandle with the given name, an empty DataHandle if no such DataHandle exists.
DataHandle getData(const std::string& name) const;
......@@ -37,15 +37,17 @@ namespace TUMVis {
* A DataHandle is responsible to manage the lifetime of an AbstractData instance.
* Therefore, it implements a reference counting technique in cooperation with AbstractData.
* This class can be considered as thread safe under the following conditions:
* * A single DataHandle instance must not be accessed from different threads.
* * Concurrent access to the same AbstractData instance via different DataHandles is safe.
* \note For clarity: An AbstractData instance can be referenced by multiple DataHandles. As soon
* as it is afterwards reference by 0 DataHandles the AbstractData instance will be destroyed.
* as it is afterwards reference by 0 DataHandles, the AbstractData instance will be destroyed.
* Also remember that a DataHandle takes ownership of the given AbstractData instance. So do
* not delete it once it has been assigned to a DataHandle (respectively DataContainer) or mess
* with its reference counting!
* \note Reference counting implementation inspired from Scott Meyers: More Effective C++, Item 29
* \todo Check for thread-safety
class DataHandle {
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment