realroot_doc 0.1.1
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 57 of file shared_object.hpp.


Member Typedef Documentation

typedef const R* const_iterator

Definition at line 108 of file shared_object.hpp.

typedef R element_type

Definition at line 60 of file shared_object.hpp.

typedef R* iterator

Definition at line 107 of file shared_object.hpp.

typedef R object_type

Definition at line 106 of file shared_object.hpp.


Constructor & Destructor Documentation

shared_object ( P0  a) [inline]

Definition at line 111 of file shared_object.hpp.

: body(new rep(a)){};
shared_object ( P0  a,
P1  b 
) [inline]

Definition at line 113 of file shared_object.hpp.

: body(new rep(a,b)){};
shared_object ( P0  a,
P1  b,
P2  c 
) [inline]

Definition at line 115 of file shared_object.hpp.

: body(new rep(a,b,c)){};
shared_object ( P0  a,
P1  b,
P2  c,
P3  d 
) [inline]

Definition at line 117 of file shared_object.hpp.

: body(new rep(a,b,c,d)){};
shared_object ( ) [inline]

Definition at line 118 of file shared_object.hpp.

                  : body(new rep())  {
    //std::cout<<"body   "<<body<<" "<<body->refc<<std::endl; 
  }
shared_object ( const R &  obj_arg) [inline]

Definition at line 121 of file shared_object.hpp.

: body(new rep(obj_arg)) {}
shared_object ( const shared_object< R > &  s) [inline]

Definition at line 122 of file shared_object.hpp.

: body(s.body) {++body->refc;}
shared_object ( rep s) [inline]

Definition at line 123 of file shared_object.hpp.

: body(s) {++body->refc;}
~shared_object ( ) [inline]

Definition at line 124 of file shared_object.hpp.

{leave(); }

Member Function Documentation

void leave ( ) [inline]

Definition at line 99 of file shared_object.hpp.

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

  {assert(body->refc>0);
    //std::cout<<"Leave  "<<body<<" "<<body->refc<<std::endl; 
    if (! --body->refc) delete body;}
const R& operator* ( ) const [inline]

Definition at line 138 of file shared_object.hpp.

{ return  body->obj; }
R& operator* ( ) [inline]

Definition at line 135 of file shared_object.hpp.

{ if (body->refc > 1) divorce(); return  body->obj; }
iterator operator-> ( ) [inline]

Definition at line 134 of file shared_object.hpp.

{ if (body->refc > 1) divorce(); return &body->obj; }
const_iterator operator-> ( ) const [inline]

Definition at line 137 of file shared_object.hpp.

{ return &body->obj; }
shared_object& operator= ( const shared_object< R > &  s) [inline]

Definition at line 126 of file shared_object.hpp.

    {
      if (this!=&s) {s.body->refc++; leave(); body=s.body;}
      return *this;
    }
int ref ( ) [inline]

Definition at line 141 of file shared_object.hpp.

{return body->refc;}
int ref ( ) const [inline]

Definition at line 140 of file shared_object.hpp.

{return body->refc;}
void swap ( shared_object< R > &  s2) [inline]

Definition at line 132 of file shared_object.hpp.

Referenced by shared_object< std::vector< homography< real > > >::swap().

{ std::swap(body,s2.body); }

Member Data Documentation


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