SOFA API  1a4bb3e7
Open source framework for multi-physics simuation
sofa::core::objectmodel::WriteAccessWithRawPtr Class Reference

#include <BaseData.h>

Detailed Description

A WriteAccessWithRawPtr is a RAII class, holding a reference to a given container and providing access to its data through a non-const void* ptr taking care of the beginEdit/endEdit pairs.

Advantadges of using a WriteAccessWithRawPtr are :

  • It can be faster that the default methods and operators of the container, as verifications and changes notifications can be handled in the accessor's constructor and destructor instead of at each item access.

Public Attributes

void * ptr { nullptr }
 

Public Member Functions

 WriteAccessWithRawPtr (BaseData *data)
 
 ~WriteAccessWithRawPtr ()
 

Attribute details

◆ ptr

void* sofa::core::objectmodel::WriteAccessWithRawPtr::ptr { nullptr }

Constructor details

◆ WriteAccessWithRawPtr()

sofa::core::objectmodel::WriteAccessWithRawPtr::WriteAccessWithRawPtr ( BaseData data)
inlineexplicit

◆ ~WriteAccessWithRawPtr()

sofa::core::objectmodel::WriteAccessWithRawPtr::~WriteAccessWithRawPtr ( )
inline