oaVoidPointerAppDef Class Template Reference

Inheritance diagram for oaVoidPointerAppDef:

oaAppDef oaSessionObject oaObject


Public Methods

void set (T *object, const void *value)
void * get (const T *object)

Static Public Methods

oaVoidPointerAppDef< T > * get (const oaString &name)
oaVoidPointerAppDef< T > * get (const oaString &name, const oaAppObjectDef *objDef)
oaVoidPointerAppDef< T > * find (const oaString &name)
oaVoidPointerAppDef< T > * find (const oaString &name, const oaAppObjectDef *objDef)

Detailed Description

template<class T>
class oaVoidPointerAppDef< T >

The oaVoidPointerAppDef class implements an application-specific extension to a particular type of data in a database.

Once created, a pointer field is added to each object of the specified dataType, with the specified default value. Applications can use the new data field for whatever purpose is necessary.

This type of extension is useful because it allows externally defined memory to be stored with each object being extended.

Note: Because the data is externally defined, this extension type cannot be marked persistent.

For additional information on defining and using AppDefs, see oaAppDef and Extending the Database in the Programmer's Guide.


Member Function Documentation

template<class T>
oaVoidPointerAppDef< T > * oaVoidPointerAppDef< T >::find const oaString &    name,
const oaAppObjectDef *    objDef
[inline, static]
 

This function returns an oaVoidPointerAppDef object with this dataType and the specified 'name' that is associated with the specified object extension 'objDef'.

Parameters:
name The name of the oaAppDef object to look for
objDef A constant pointer to the object extension

template<class T>
oaVoidPointerAppDef< T > * oaVoidPointerAppDef< T >::find const oaString &    name [inline, static]
 

This function returns an oaVoidPointerAppDef object with this dataType and the specified 'name' if it exists.

Parameters:
name The name of the oaAppDef object to look for

template<class T>
void * oaVoidPointerAppDef< T >::get const T *    object [inline]
 

This function returns the value of this data extension on the specified object.

Parameters:
object The object to search
Exceptions:
oacInvalidDesignObjectForAppDef 

template<class T>
oaVoidPointerAppDef< T > * oaVoidPointerAppDef< T >::get const oaString &    name,
const oaAppObjectDef *    objDef
[inline, static]
 

This function constructs a void pointer extension with the specified name for the specified object type.

Parameters:
name The name given to the oaVoidPointerAppDef object
objDef The object extension with which to associate the extension
Exceptions:
oacAppDefExists 

template<class T>
oaVoidPointerAppDef< T > * oaVoidPointerAppDef< T >::get const oaString &    name [inline, static]
 

This function constructs a void pointer extension with the specified name.

Parameters:
name The name given to the oaVoidPointerAppDef object
Exceptions:
oacAppDefExists 

template<class T>
void oaVoidPointerAppDef< T >::set T *    object,
const void *    value
[inline]
 

This function sets the value of this data extension.

Parameters:
object The object on which to set the extension
value The value to set for the extension
Exceptions:
oacInvalidDesignObjectForAppDef 


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

Return to top of page