IMP logo

IMP::core::EditGuard< Container > Class Template Reference


Detailed Description

template<class Container>
class IMP::core::EditGuard< Container >

RAII class for objects with batch editing modes.

This object sets the editing mode to true if the object is not being edited when it is created. If it changed the editing mode on creation, the mode is set to false when the object is destroyed.

    {
      EditGuard<ListSingletonContainer> guard(lsc);
      for (unsigned int i=0; i< ps.size(); ++i) {
        if (is_good(ps[i])) lsc->add_particle(ps[i]);
      }
      // guard is destoyed end closes the editing session
     }
See also:
FilteredListSingletonContainer

FilteredListPairContainer

ListSingletonContainer

ListPairContainer

Inheritance diagram for IMP::core::EditGuard< Container >:

Inheritance graph
[legend]

Public Member Functions

 EditGuard (Container *c)
void reset ()
void set (Container *c)

The documentation for this class was generated from the following file:

Generated on Mon Mar 8 23:08:56 2010 for IMP by doxygen 1.5.8