Change comment format to support automatic document generation using the CppDoc application.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@251 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt 2011-05-31 18:17:12 +00:00
parent f80e8b297e
commit 1678a7e673
1 changed files with 17 additions and 17 deletions

View File

@ -47,27 +47,27 @@
// void some_function() {
// // The MyFoo object that |foo| represents starts with a single
// // reference.
// CefRefPtr<MyFoo> foo = new MyFoo();
// foo->Method(param);
// CefRefPtr&lt;MyFoo&gt; foo = new MyFoo();
// foo-&gt;Method(param);
// // |foo| is released when this function returns
// }
//
// void some_other_function() {
// CefRefPtr<MyFoo> foo = new MyFoo();
// CefRefPtr&lt;MyFoo&gt; foo = new MyFoo();
// ...
// foo = NULL; // explicitly releases |foo|
// ...
// if (foo)
// foo->Method(param);
// foo-&gt;Method(param);
// }
// </pre>
// The above examples show how CefRefPtr<T> acts like a pointer to T.
// Given two CefRefPtr<T> classes, it is also possible to exchange
// The above examples show how CefRefPtr&lt;T&gt; acts like a pointer to T.
// Given two CefRefPtr&lt;T&gt; classes, it is also possible to exchange
// references between the two objects, like so:
// <pre>
// {
// CefRefPtr<MyFoo> a = new MyFoo();
// CefRefPtr<MyFoo> b;
// CefRefPtr&lt;MyFoo&gt; a = new MyFoo();
// CefRefPtr&lt;MyFoo&gt; b;
//
// b.swap(a);
// // now, |b| references the MyFoo object, and |a| references NULL.
@ -77,8 +77,8 @@
// object, simply use the assignment operator:
// <pre>
// {
// CefRefPtr<MyFoo> a = new MyFoo();
// CefRefPtr<MyFoo> b;
// CefRefPtr&lt;MyFoo&gt; a = new MyFoo();
// CefRefPtr&lt;MyFoo&gt; b;
//
// b = a;
// // now, |a| and |b| each own a reference to the same MyFoo object.
@ -88,16 +88,16 @@
// Reference counted objects can also be passed as function parameters and
// used as function return values:
// <pre>
// void some_func_with_param(CefRefPtr<MyFoo> param) {
// void some_func_with_param(CefRefPtr&lt;MyFoo&gt; param) {
// // A reference is added to the MyFoo object that |param| represents
// // during the scope of some_func_with_param() and released when
// // some_func_with_param() goes out of scope.
// }
//
// CefRefPtr<MyFoo> some_func_with_retval() {
// CefRefPtr&lt;MyFoo&gt; some_func_with_retval() {
// // The MyFoo object that |foox| represents starts with a single
// // reference.
// CefRefPtr<MyFoo> foox = new MyFoo();
// CefRefPtr&lt;MyFoo&gt; foox = new MyFoo();
//
// // Creating the return value adds an additional reference.
// return foox;
@ -107,12 +107,12 @@
// }
//
// void and_another_function() {
// CefRefPtr<MyFoo> foo = new MyFoo();
// CefRefPtr&lt;MyFoo&gt; foo = new MyFoo();
//
// // pass |foo| as a parameter.
// some_function(foo);
//
// CefRefPtr<MyFoo> foo2 = some_func_with_retval();
// CefRefPtr&lt;MyFoo&gt; foo2 = some_func_with_retval();
// // Now, since we kept a reference to the some_func_with_retval() return
// // value, |foo2| is the only class pointing to the MyFoo object created
// in some_func_with_retval(), and it has a reference count of 1.
@ -127,11 +127,11 @@
// <pre>
// {
// // Create a vector that holds MyFoo objects.
// std::vector<CefRefPtr<MyFoo> > MyFooVec;
// std::vector&lt;CefRefPtr&lt;MyFoo&gt; &gt; MyFooVec;
//
// // The MyFoo object that |foo| represents starts with a single
// // reference.
// CefRefPtr<MyFoo> foo = new MyFoo();
// CefRefPtr&lt;MyFoo&gt; foo = new MyFoo();
//
// // When the MyFoo object is added to |MyFooVec| the reference count
// // is increased to 2.