1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-10 06:39:49 +00:00
OpenMW/apps/openmw/mwworld/ptr.cpp
Chris Robinson 11166a1a17 Don't store the type name string in the Ptr
This should get rid of all heap allocations caused by constructing or copying
Ptr objects.
2013-08-14 00:45:28 -07:00

42 lines
691 B
C++

#include "ptr.hpp"
#include <cassert>
#include "containerstore.hpp"
const std::string MWWorld::Ptr::sEmptyString;
ESM::CellRef& MWWorld::Ptr::getCellRef() const
{
assert (mCellRef);
if (mContainerStore)
mContainerStore->flagAsModified();
return *mCellRef;
}
MWWorld::RefData& MWWorld::Ptr::getRefData() const
{
assert (mRefData);
if (mContainerStore)
mContainerStore->flagAsModified();
return *mRefData;
}
void MWWorld::Ptr::setContainerStore (ContainerStore *store)
{
assert (store);
assert (!mCell);
mContainerStore = store;
}
MWWorld::ContainerStore *MWWorld::Ptr::getContainerStore() const
{
return mContainerStore;
}