Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'intern/memutil')
-rw-r--r--intern/memutil/MEM_CacheLimiter.h13
-rw-r--r--intern/memutil/MEM_RefCountPtr.h17
-rw-r--r--intern/memutil/MEM_SmartPtr.h16
3 files changed, 28 insertions, 18 deletions
diff --git a/intern/memutil/MEM_CacheLimiter.h b/intern/memutil/MEM_CacheLimiter.h
index 3e8ae7e5a4d..d5a44375885 100644
--- a/intern/memutil/MEM_CacheLimiter.h
+++ b/intern/memutil/MEM_CacheLimiter.h
@@ -29,20 +29,22 @@
#define __MEM_CACHELIMITER_H__
/**
- * @section MEM_CacheLimiter
+ * \section MEM_CacheLimiter
* This class defines a generic memory cache management system
* to limit memory usage to a fixed global maximum.
*
- * Please use the C-API in MEM_CacheLimiterC-Api.h for code written in C.
+ * \note Please use the C-API in MEM_CacheLimiterC-Api.h for code written in C.
*
* Usage example:
*
+ * \code{.cpp}
* class BigFatImage {
* public:
* ~BigFatImage() { tell_everyone_we_are_gone(this); }
* };
*
- * void doit() {
+ * void doit()
+ * {
* MEM_Cache<BigFatImage> BigFatImages;
*
* MEM_Cache_Handle<BigFatImage>* h = BigFatImages.insert(new BigFatImage);
@@ -50,11 +52,12 @@
* BigFatImages.enforce_limits();
* h->ref();
*
- * work with image...
+ * // work with image...
*
* h->unref();
*
- * leave image in cache.
+ * // leave image in cache.
+ * \endcode
*/
#include <list>
diff --git a/intern/memutil/MEM_RefCountPtr.h b/intern/memutil/MEM_RefCountPtr.h
index da10e689fbf..ea865eadd47 100644
--- a/intern/memutil/MEM_RefCountPtr.h
+++ b/intern/memutil/MEM_RefCountPtr.h
@@ -30,9 +30,9 @@
*/
/**
- * @file MEM_RefCountPtr.h
+ * \file MEM_RefCountPtr.h
* Declaration of MEM_RefCounted and MEM_RefCountable classes.
- * @author Laurence
+ * \author Laurence
*/
#ifndef __MEM_REFCOUNTPTR_H__
@@ -41,7 +41,7 @@
#include <stdlib.h> // for NULL !
/**
- * @section MEM_RefCountable
+ * \section MEM_RefCountable
* This is a base class for reference countable objects.
* If you want an object to be shared using a reference
* counted system derrivce from this class. All subclasses
@@ -50,9 +50,9 @@
* defining a static New() method that returns a ref counted
* ptr to a new()ly allocated instance.
*
- * @section Example subclass
- *
+ * \section Example subclass
*
+ * \code{.cpp}
* class MySharedObject : public MEM_RefCountable {
*
* private :
@@ -68,6 +68,7 @@
*
* // other member functions
* };
+ * \endcode
*
* Alternitively you may first wish to define a fully functional
* class and then define a reference counting wrapper for this class.
@@ -75,6 +76,8 @@
* counting.
*
* E.g.
+ *
+ * \code{.cpp}
* class UsefullClass {
* private :
* ...
@@ -108,7 +111,7 @@
* // mechanism to handle object lifetime.
* ~RcUsefullClass();
* };
- *
+ * \endcode
*
*/
@@ -168,7 +171,7 @@ public :
};
/**
- * @section MEM_RefCountPtr
+ * \section MEM_RefCountPtr
*/
template
diff --git a/intern/memutil/MEM_SmartPtr.h b/intern/memutil/MEM_SmartPtr.h
index dd19aae9db9..e0d7b81290f 100644
--- a/intern/memutil/MEM_SmartPtr.h
+++ b/intern/memutil/MEM_SmartPtr.h
@@ -43,7 +43,7 @@
/**
- * @section MEM_SmartPtr
+ * \section MEM_SmartPtr
* This class defines a smart pointer similar to that defined in
* the Standard Template Library but without the painful get()
* semantics to access the internal c style pointer.
@@ -58,8 +58,9 @@
* should not be shared. This is not reliably enforceable in C++
* but this class attempts to make the 1-1 relationship clear.
*
- * @section Example usage
+ * \section Example usage
*
+ * \code{.cpp}
* class foo {
* ...constructors accessors etc.
* int x[1000];
@@ -86,18 +87,21 @@
* private :
* MEM_SmartPtr<foo> m_foo;
* }
+ * \endcode
*
* You may also safely construct vectors of MEM_SmartPtrs and
* have the vector own stuff you put into it.
*
* e.g.
+ * \code{.cpp}
* {
- * std::vector<MEM_SmartPtr<foo> > foo_vector;
- * foo_vector.push_back( new foo());
- * foo_vector.push_back( new foo());
+ * std::vector<MEM_SmartPtr<foo> > foo_vector;
+ * foo_vector.push_back( new foo());
+ * foo_vector.push_back( new foo());
*
- * foo_vector[0]->bla();
+ * foo_vector[0]->bla();
* } // foo_vector out of scope => heap memory freed for both foos
+ * \endcode
*
* @warning this class should only be used for objects created
* on the heap via the new function. It will not behave correctly