Home

entity_callback Class Reference
[Part Management]

Provides notification of changes to entities. More...

#include <ent_cb.hxx>

Inheritance diagram for entity_callback:

Inheritance graph
[legend]
Collaboration diagram for entity_callback:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 entity_callback ()
 C++ constructor, creating an entity_callback.
virtual void execute (entity_event_type en_type, ENTITY *en)
 Executes the callback by updating the rendering appropriate to the specified entity and event.
toolkit_callbacknext ()
 Specifies the next callback command.
toolkit_callbackprev ()
 Specifies the previous callback command.
virtual ~entity_callback ()
 C++ destructor, deleting an entity_callback.


Detailed Description

Provides notification of changes to entities.


Role: C++ callbacks are similar to Scheme hooks. They are developer-defined functions that the system calls at predefined times.

This class is a base class from which other classes are derived, which receives notification of changes to entities. To use this class, derive a new class from entity_callback, and overload the virtual execute method. To activate the callback, add it to the entity callback list by calling get_entity_callback_list.

Entity callbacks are called when:
A new entity is created. An entity is deleted. An entity is created by the roll back system and rolls back over a delete or rolls forward over a create. An entity is deleted by the roll back system and rolls back over a create or rolls forward over a delete. An entity is changed by the rollback system. The part containing the entity is deleted. The entity is removed from its part. The entity is updated in some other way.

The execute method is passed a pointer to the ENTITY in question and an entity_event_type enumerator specifying the type of operation being performed. The method returns no value.

Constructor & Destructor Documentation

entity_callback::entity_callback (  )  [inline]

C++ constructor, creating an entity_callback.

virtual entity_callback::~entity_callback (  )  [inline, virtual]

C++ destructor, deleting an entity_callback.


Member Function Documentation

virtual void entity_callback::execute ( entity_event_type  en_type,
ENTITY en 
) [virtual]

Executes the callback by updating the rendering appropriate to the specified entity and event.



Role: The base class implementation effectively does nothing.

Parameters:
en_type the event that has changed the entity directly or through its part.
ent the entity whose rendering is to be updated.

Reimplemented in scm_pick_manager.

toolkit_callback* toolkit_callback::next (  )  [inline, inherited]

Specifies the next callback command.

toolkit_callback* toolkit_callback::prev (  )  [inline, inherited]

Specifies the previous callback command.