Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Object Class Reference

#include <Object.h>

Collaboration diagram for Object:

Public Member Functions

 Object ()
 
 Object (Object_base *base)
 
 Object (const Object &o)
 
 ~Object ()
 
Objectoperator= (const Object &o)
 
bool is_empty () const
 

Protected Attributes

Object_baseptr
 

Friends

template<class T >
bool assign (T &t, const Object &o)
 

Detailed Description

Definition at line 93 of file Object.h.

Constructor & Destructor Documentation

Object ( )
inline

Definition at line 96 of file Object.h.

96 : ptr( static_cast<Object_base*>(0) ) {}
Object_base * ptr
Definition: Object.h:126
Object ( Object_base base)
inline

Definition at line 98 of file Object.h.

References CGAL_kernel_assertion, Ref_counted::count, and Object::ptr.

99  {
100  ptr = base;
101  CGAL_kernel_assertion( !ptr || (ptr->count == 1));
102  }
unsigned int count
Definition: Handle_for.h:76
Object_base * ptr
Definition: Object.h:126
#define CGAL_kernel_assertion(EX)
Object ( const Object o)
inline

Definition at line 104 of file Object.h.

References Ref_counted::count, and Object::ptr.

104  : ptr(o.ptr)
105  { if (ptr) ptr->count++; }
unsigned int count
Definition: Handle_for.h:76
Object_base * ptr
Definition: Object.h:126
~Object ( )
inline

Definition at line 107 of file Object.h.

References Ref_counted::count, and Object::ptr.

108  { if (ptr && (--ptr->count == 0)) { delete ptr; } }
unsigned int count
Definition: Handle_for.h:76
Object_base * ptr
Definition: Object.h:126

Member Function Documentation

bool is_empty ( ) const
inline

Definition at line 120 of file Object.h.

References Object::ptr.

120 { return ptr == static_cast<Object_base*>(0); }
Object_base * ptr
Definition: Object.h:126
Object& operator= ( const Object o)
inline

Definition at line 111 of file Object.h.

References Ref_counted::count, and Object::ptr.

112  {
113  if (o.ptr) o.ptr->count++;
114  if (ptr && (--ptr->count == 0)) { delete ptr; }
115  ptr = o.ptr;
116  return *this;
117  }
unsigned int count
Definition: Handle_for.h:76
Object_base * ptr
Definition: Object.h:126

Friends And Related Function Documentation

bool assign ( T &  t,
const Object o 
)
friend

Definition at line 138 of file Object.h.

139 {
140 # ifdef CGAL_CFG_DYNAMIC_CAST_BUG
141  Wrapper<T> instantiate_it;
142 # endif // CGAL_CFG_DYNAMIC_CAST_BUG
143  Wrapper<T>* wp = dynamic_cast<Wrapper<T>*>(o.ptr);
144  if ( wp == static_cast<Wrapper<T>*>(0) ) { return false; }
145  t = *(wp);
146  return true;
147 }

Member Data Documentation

Object_base* ptr
protected

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