On Tue, Sep 15, 2009 at 1:45 PM, John Peterson
<[email protected]> wrote:
> On Tue, Sep 15, 2009 at 12:19 PM, Derek Gaston <[email protected]> wrote:
>>
>> Could we add a counter to the mesh that says the number of times it's
>> changed? And have that counter get incremented every time one of the
>> Thoughts?
>
> I've thought about doing this before, but unfortunately it's very hard
> to get absolutely correct in the library (at least, without a major
> re-design of the Mesh).
Along these lines: the idea would be to have a
class MeshProxy : public MeshBase
{
virtual void clear ();
// etc...
private:
unsigned _version;
Mesh _actual_mesh;
};
MeshProxy is derived from MeshBase so that it's forced to re-implement
all the right interfaces.
The guts of MeshProxy's non-const functions would look something like this:
void MeshBase::clear ()
{
_version++;
_actual_mesh->clear();
}
So, it bumps the internal version whenever a non-const member (or any
other member you want) is called.
There are definitely problems with this approach, for one, MeshBase is
not a true abstract base class due to those data pointers we were
talking about earlier. But this is the idea I had...
--
John
------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Libmesh-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libmesh-devel