/[escript]/branches/more_shared_ptrs_from_1812/escript/src/DataAbstract.cpp
ViewVC logotype

Diff of /branches/more_shared_ptrs_from_1812/escript/src/DataAbstract.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1827 by jfenwick, Fri Sep 26 00:58:05 2008 UTC revision 1828 by jfenwick, Thu Oct 2 04:52:11 2008 UTC
# Line 19  using namespace std; Line 19  using namespace std;
19    
20  namespace escript {  namespace escript {
21    
22    /**
23    \brief Returns smart pointer which is managing this object.
24    If one does not exist yet it creates one.
25    
26    Note: This is _not_ equivalent to weak_ptr::lock.
27    */
28    DataAbstract_ptr DataAbstract::getPtr()
29    {
30      if (_internal_weak_this.expired())
31      {
32        return DataAbstract_ptr(this);  
33      }
34      else
35      {
36        return shared_from_this();
37      }
38    }
39    
40    const_DataAbstract_ptr DataAbstract::getPtr() const
41    {
42      if (_internal_weak_this.expired())
43      {
44        return const_DataAbstract_ptr(this);
45      }
46      else
47      {
48        return shared_from_this();
49      }
50    }
51    
52    
53    
54  DataAbstract::DataAbstract(const FunctionSpace& what, const ShapeType& shape, bool isDataEmpty):  DataAbstract::DataAbstract(const FunctionSpace& what, const ShapeType& shape, bool isDataEmpty):
55      m_noDataPointsPerSample(what.getNumDPPSample()),      m_noDataPointsPerSample(what.getNumDPPSample()),
56      m_noSamples(what.getNumSamples()),      m_noSamples(what.getNumSamples()),

Legend:
Removed from v.1827  
changed lines
  Added in v.1828

  ViewVC Help
Powered by ViewVC 1.1.26