Skip to content
Snippets Groups Projects
Commit 997814a8 authored by Sebastian Eibl's avatar Sebastian Eibl
Browse files

[API] changed BodyStatistics to use shared_ptr instead of reference

parent 14d59db3
No related merge requests found
......@@ -42,7 +42,7 @@ void BodyStatistics::operator()()
velocitySample_.clear();
massSample_.clear();
for( auto blockIt = blockStorage_.begin(); blockIt != blockStorage_.end(); ++blockIt )
for( auto blockIt = blockStorage_->begin(); blockIt != blockStorage_->end(); ++blockIt )
{
auto storage = blockIt->getData< pe::Storage >( bodyStorageID_ );
const pe::BodyStorage & localStorage = (*storage)[0];
......
......@@ -36,7 +36,7 @@ class BodyStatistics
{
public:
BodyStatistics( const BlockStorage & blockStorage, const BlockDataID & bodyStorageID )
BodyStatistics( const shared_ptr<BlockStorage>& blockStorage, const BlockDataID & bodyStorageID )
: blockStorage_( blockStorage ), bodyStorageID_( bodyStorageID )
{ }
......@@ -52,8 +52,8 @@ public:
real_t totalMass() const { return massSample_.sum(); }
private:
const BlockStorage & blockStorage_;
BlockDataID bodyStorageID_;
const shared_ptr<BlockStorage> blockStorage_;
const BlockDataID bodyStorageID_;
math::Sample localBodiesBlockSample_, shadowBodiesBlockSample_;
math::Sample localBodiesProcessSample_, shadowBodiesProcessSample_;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment