CMS 3D CMS Logo

IgRep Class Reference

Base class for all object representations. More...

#include <Iguana/Framework/interface/IgRep.h>

Inheritance diagram for IgRep:

Ig3DBaseRep IgNTupleRep IgQtTreeRep IgQtTwigRep IgTextRep IgUIDRep IgXMLRep VisRootRep

List of all members.

Public Member Functions

virtual IgRepContextcontext (void) const =0
virtual IgModelmodel (void) const =0
virtual ~IgRep (void)

Protected Member Functions

virtual void context (IgRepContext *context)=0

Friends

class IgRepContext


Detailed Description

Base class for all object representations.

This is the base interface that all IgRepresentable representations must conform to. It is up to the browser and model to decide what needs to go in the derived class. However, at the very minimum two things must be provided: access to the IgRepContext and pointer to the IgModel the rep belongs to. The accessors for the former is context(), for the latter model().

The derived reps are usually created in the extension of the IgBrowserMethods::doRepresent() multi-method. Upon creation, the derived class must set its internal IgRepContext pointer to null. Immediately after the creation a new IgRepContext will be created for this new rep; this will cause the protected context() method to be invoked. At that point the derived class should set its IgRepContext from the argument.

The derived classes must be prepared to handle destruction in two ways: the IgRepresentable is going away and the IgRepContext is deleting the rep, or someone else is deleting rep (e.g. the model). In the former case the caller will have gotten rid of references to the application object before destructing the rep (in fact the application object most probably no longer exists); in the latter case the object probably still exists. In the former case the rep must take care not to delete the context. The way to detect this is that prior to destruction the IgRepContext will have set its rep to null. Otherwise the context will still point to this rep and the rep should first invoke IgRepContext::erase() with false as argument, and the delete the context.

(FIXME: Rep garbage collection might delete the rep as well; this falls in the second case but the rep must realise that the model might not yet know. But we don't have garbage collection yet...)

Definition at line 52 of file IgRep.h.


Constructor & Destructor Documentation

IgRep::~IgRep ( void   )  [virtual]

Definition at line 15 of file IgRep.cc.

00016 {}


Member Function Documentation

virtual void IgRep::context ( IgRepContext context  )  [protected, pure virtual]

Implemented in Ig3DBaseRep, IgNTupleRep, IgSimpleTextRep, IgUIDRep, IgXMLRep, IgQtTreeRep, IgQtTwigRep, and VisRootRep.

virtual IgRepContext* IgRep::context ( void   )  const [pure virtual]

Implemented in Ig3DBaseRep, IgNTupleRep, IgSimpleTextRep, IgUIDRep, IgXMLRep, IgQtTreeRep, IgQtTwigRep, and VisRootRep.

Referenced by IgRepContext::IgRepContext().

virtual IgModel* IgRep::model ( void   )  const [pure virtual]

Implemented in Ig3DBaseRep, IgNTupleRep, IgSimpleTextRep, IgUIDRep, IgXMLRep, IgQtTreeRep, IgQtTwigRep, and VisRootRep.

Referenced by IgBrowserMethods::commit(), IgBrowserMethods::expand(), IgRepContext::IgRepContext(), IgRepContext::model(), and IgBrowserMethods::update().


Friends And Related Function Documentation

friend class IgRepContext [friend]

Definition at line 61 of file IgRep.h.


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:25:37 2009 for CMSSW by  doxygen 1.5.4