Scroll to navigation

CSolver(3U) InterViews Reference Manual CSolver(3U)

NAME

CSolver - enforces connector semantics

SYNOPSIS

#include <Unidraw/csolver.h>

DESCRIPTION

A CSolver object defines and implements a model for specifyingconnectivity semantics that connector subclasses can build upon toimplement their specialized semantics. Normally, only one CSolverinstance is used per application, and only connector subclasses needaccess it. The Unidraw class constructor initializes thecsolver global to point to a CSolver instance it creates. Thus applications should not instantiate CSolver directly.

CSolver models a connection between two connectors (regardless oftheir particular subclass or semantics) as a pair of genericconnectors with a piece of CGlue interposed. The CGlue characterizesthe relationship between the connectors' centers in terms of a naturalsize (which corresponds to the distance between the centers),elasticity, and deformation limits. Connector subclasses specifytheir connectivity behavior with a CGlue instance and subsequentlyrely on the CSolver to reorient them to conform to that behavior. Forexample, when a pin is told to connect itself to another pin, itregisters with the global csolver a connection containing the twoconnectors (the pins themselves) and a piece of CGlue having zeronatural size, elasticity, and deformation limits. This specificationeffectively constrains the connectors' centers to coincide. Theconnectivity semantics of other connector combinations, includingthose involving application-specific connectors, must be specifiedusing CGlue.

PUBLICOPERATIONS

Create a new instance. Application programs do not normallyinstantiate CSolver explicitly.
Specify a connection between two connectors, optionally with a pieceof CGlue interposed. Omitting the CGlue parameter is equivalent tospecifying a connection with CGlue having zero natural size,elasticity, and deformation limits.
Destroy the connection(s) established between two connectors (thetwo-parameter form), or destroy all connections to a given connector(the one-parameter form).
Solve instructs the CSolver to reorient connected connectors toconform to their connectivity semantics as reflected by its connectionspecifications. Normally this function is called automatically andonly in response to Unidraw::Update.
CSolverState is a class that encapsulates all the information aboutthe connections in which a connector participates. Only CSolver cancreate or do anything with a CSolverState instance. GetStateinitializes and returns a CSolverState instance for the givenconnector, and SetState establishes the connections that aCSolverState instance specifies without disturbing existingconnections. These operations are useful when it is necessary toreestablish a connector's connections after they have been lost, forexample, by removing the connector from the component hierarchy (ascaused by a command to delete the component).
Explicitly read/write the csolver's contents from/to disk. Normallyonly a catalog calls these operations.

SEEALSO

Catalog(3U), GGlue(3U), Connector(3U), globals(3U)

20 November 1990 Unidraw