oaSession Class Reference

Inheritance diagram for oaSession:

oaSessionObject oaObject


Public Methods

oaUInt8 calcVMSize () const
void minimizeVM ()
oaCollection< oaAppDef, oaSession > getAppDefs ()
oaCollection< oaAppObjectDef, oaSession > getAppObjectDefs ()
oaCollection< oaConstraintParamDef, oaSession > getConstraintParamDefs () const
oaCollection< oaConstraintDef, oaSession > getConstraintDefs () const
oaCollection< oaDerivedLayerParamDef, oaSession > getDerivedLayerParamDefs () const
oaCollection< oaDerivedLayerDef, oaSession > getDerivedLayerDefs () const
oaCollection< oaGroupDef, oaSession > getGroupDefs () const
oaCollection< oaConstraintGroupDef, oaSession > getConstraintGroupDefs () const
void setThreadUseModel (oaThreadUseModel useModelIn)
oaThreadUseModel getThreadUseModel () const

Static Public Methods

oaSession * get ()

Detailed Description

The oaSession class implements a session database. This is a non-persistent "database" which is used as the database parent for session-wide information. This session information is represented by the object classes which inherit from oaSessionObject, such as oaAppDef and oaViewType.

A session database is automatically created and maintained as needed by the OpenAccess implementation. There is only one session database per OpenAccess session.


Member Function Documentation

oaUInt8 oaSession::calcVMSize   const
 

This function calculates and returns the amount of virtual memory that OpenAccess is currently using, including all open databases.

oaSession * oaSession::get   [static]
 

This function returns the global session object.

oaCollection< oaAppDef, oaSession > oaSession::getAppDefs  
 

This function returns the collection of extensions that are currently defined.

oaCollection< oaAppObjectDef, oaSession > oaSession::getAppObjectDefs  
 

This function returns a collection of all oaAppObjectDefs currently defined.

oaCollection< oaConstraintDef, oaSession > oaSession::getConstraintDefs   const
 

This function returns the collection of all currently defined constraint definitions.

oaCollection< oaConstraintGroupDef, oaSession > oaSession::getConstraintGroupDefs   const
 

This function returns the collection of all currently defined constraint group definitions.

oaCollection< oaConstraintParamDef, oaSession > oaSession::getConstraintParamDefs   const
 

This function returns the collection of constraint parameter definitions that are currently defined.

oaCollection< oaDerivedLayerDef, oaSession > oaSession::getDerivedLayerDefs   const
 

This function returns the collection of all currently defined derived layer definitions.

oaCollection< oaDerivedLayerParamDef, oaSession > oaSession::getDerivedLayerParamDefs   const
 

This function returns the collection of all currently defined derived layer parameter definitions.

oaCollection< oaGroupDef, oaSession > oaSession::getGroupDefs   const
 

This function returns the collection of all currently defined group definitions.

oaThreadUseModel oaSession::getThreadUseModel   const
 

This function returns the current thread use model of the session.

void oaSession::minimizeVM  
 

This function minimizes the amount of virtual memory currently used by OpenAccess. It releases memory OpenAccess is holding in reserve for future use, as well as dynamically allocated data structures that can be rebuilt as needed. Any libraries and databases that are in memory remain in memory, no objects are destroyed, and no object pointers are invalidated by this function.

Applications can call this function in several scenarios:

  • An application loads a number of OpenAccess databases, builds application-specific data structures, purges all of the databases, runs some algorithms that require large chunks of memory, then reopens the OpenAccess databases to annotate the results.
  • An application loads a number of OpenAccess databases, builds application-specific data structures, purges all of the databases, then wants to recover all of the memory used by OA.
  • An application creates or edits an OpenAccess database, causing OpenAccess to build transient data structures, then wants to minimize the memory used by the database before starting a phase of processing that interacts with OpenAccess in different ways.

In the first two cases, minimizeVM() should be called after purging the OpenAccess databases. In the third case minimizeVM() should be called between the different phases of processing.

This function should be called sparingly, as it can have a substantial impact on the performance of subsequent operations.

void oaSession::setThreadUseModel oaThreadUseModel    useModelIn
 

This function sets the thread use model for the session. The thread use model describes the way the application intends to interact with the database. By default applications are assumed to use the single threaded use model which corresponds to the OA22.04 behavior. This function does not create any threads.

Changing the thread use model will alter the behavior of the database and it can significantly affect performance and capacity. Switching from a multi-threaded use model to a single threaded use model will not undo any of the data preconditioning that occurs when setting a multi-threaded use model. See the Thread Safety of the Programmer's Guide for details regarding the performance and capacity tradeoffs as well as the application's responsibilities when using OpenAccess in a multi-threaded way.

Parameters:
useModelIn The thread use model of the application.


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

Return to top of page