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:
parent
f80e8b297e
commit
1678a7e673
|
@ -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<MyFoo> foo = new MyFoo();
|
||||
// foo->Method(param);
|
||||
// // |foo| is released when this function returns
|
||||
// }
|
||||
//
|
||||
// void some_other_function() {
|
||||
// CefRefPtr<MyFoo> foo = new MyFoo();
|
||||
// CefRefPtr<MyFoo> foo = new MyFoo();
|
||||
// ...
|
||||
// foo = NULL; // explicitly releases |foo|
|
||||
// ...
|
||||
// if (foo)
|
||||
// foo->Method(param);
|
||||
// foo->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<T> acts like a pointer to T.
|
||||
// Given two CefRefPtr<T> classes, it is also possible to exchange
|
||||
// references between the two objects, like so:
|
||||
// <pre>
|
||||
// {
|
||||
// CefRefPtr<MyFoo> a = new MyFoo();
|
||||
// CefRefPtr<MyFoo> b;
|
||||
// CefRefPtr<MyFoo> a = new MyFoo();
|
||||
// CefRefPtr<MyFoo> 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<MyFoo> a = new MyFoo();
|
||||
// CefRefPtr<MyFoo> 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<MyFoo> 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<MyFoo> some_func_with_retval() {
|
||||
// // The MyFoo object that |foox| represents starts with a single
|
||||
// // reference.
|
||||
// CefRefPtr<MyFoo> foox = new MyFoo();
|
||||
// CefRefPtr<MyFoo> 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<MyFoo> foo = new MyFoo();
|
||||
//
|
||||
// // pass |foo| as a parameter.
|
||||
// some_function(foo);
|
||||
//
|
||||
// CefRefPtr<MyFoo> foo2 = some_func_with_retval();
|
||||
// CefRefPtr<MyFoo> 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<CefRefPtr<MyFoo> > MyFooVec;
|
||||
//
|
||||
// // The MyFoo object that |foo| represents starts with a single
|
||||
// // reference.
|
||||
// CefRefPtr<MyFoo> foo = new MyFoo();
|
||||
// CefRefPtr<MyFoo> foo = new MyFoo();
|
||||
//
|
||||
// // When the MyFoo object is added to |MyFooVec| the reference count
|
||||
// // is increased to 2.
|
||||
|
|
Loading…
Reference in New Issue