shared_object< R > Class Template Reference

#include <shared_object.hpp>

List of all members.

Classes

Public Types

Public Member Functions

Public Attributes


Detailed Description

template<class R>
class mmx::shared_object< R >

Definition at line 64 of file shared_object.hpp.


Member Typedef Documentation

typedef const R* const_iterator

Definition at line 115 of file shared_object.hpp.

typedef R element_type

Definition at line 67 of file shared_object.hpp.

typedef R* iterator

Definition at line 114 of file shared_object.hpp.

typedef R object_type

Definition at line 113 of file shared_object.hpp.


Constructor & Destructor Documentation

shared_object ( P0  a  )  [inline]

Definition at line 118 of file shared_object.hpp.

00118 : body(new rep(a)){};

shared_object ( P0  a,
P1  b 
) [inline]

Definition at line 120 of file shared_object.hpp.

00120 : body(new rep(a,b)){};

shared_object ( P0  a,
P1  b,
P2  c 
) [inline]

Definition at line 122 of file shared_object.hpp.

00122 : body(new rep(a,b,c)){};

shared_object ( P0  a,
P1  b,
P2  c,
P3  d 
) [inline]

Definition at line 124 of file shared_object.hpp.

00124 : body(new rep(a,b,c,d)){};

shared_object (  )  [inline]

Definition at line 125 of file shared_object.hpp.

00125                   : body(new rep())  {
00126     //std::cout<<"body   "<<body<<" "<<body->refc<<std::endl; 
00127   }

shared_object ( const R &  obj_arg  )  [inline]

Definition at line 128 of file shared_object.hpp.

00128 : body(new rep(obj_arg)) {}

shared_object ( const shared_object< R > &  s  )  [inline]

Definition at line 129 of file shared_object.hpp.

00129 : body(s.body) {++body->refc;}

shared_object ( rep s  )  [inline]

Definition at line 130 of file shared_object.hpp.

00130 : body(s) {++body->refc;}

~shared_object (  )  [inline]

Definition at line 131 of file shared_object.hpp.

00131 {leave(); }


Member Function Documentation

void divorce (  )  [inline]
void leave (  )  [inline]

Definition at line 106 of file shared_object.hpp.

Referenced by shared_object< std::vector< homography< real > > >::operator=(), and shared_object< std::vector< homography< real > > >::~shared_object().

00107   {assert(body->refc>0);
00108     //std::cout<<"Leave  "<<body<<" "<<body->refc<<std::endl;
00109     if (! --body->refc) delete body;}

const R& operator* (  )  const [inline]

Definition at line 145 of file shared_object.hpp.

00145 { return  body->obj; }

R& operator* (  )  [inline]

Definition at line 142 of file shared_object.hpp.

00142 { if (body->refc > 1) divorce(); return  body->obj; }

const_iterator operator-> (  )  const [inline]

Definition at line 144 of file shared_object.hpp.

00144 { return &body->obj; }

iterator operator-> (  )  [inline]

Definition at line 141 of file shared_object.hpp.

00141 { if (body->refc > 1) divorce(); return &body->obj; }

shared_object& operator= ( const shared_object< R > &  s  )  [inline]

Definition at line 133 of file shared_object.hpp.

00134     {
00135       if (this!=&s) {s.body->refc++; leave(); body=s.body;}
00136       return *this;
00137     }

int ref (  )  [inline]

Definition at line 148 of file shared_object.hpp.

00148 {return body->refc;}

int ref (  )  const [inline]

Definition at line 147 of file shared_object.hpp.

00147 {return body->refc;}


Member Data Documentation


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

Generated on 6 Dec 2012 for realroot by  doxygen 1.6.1