oaVarDataAppDef Class Template Reference

Inheritance diagram for oaVarDataAppDef:

oaAppDef oaSessionObject oaObject


Public Methods

void set (T *object, oaUInt4 dataSize, const oaByte *value)
void get (const T *object, oaByte *value)
oaUInt4 getSize (const T *object)
oaUInt4 getDefaultSize () const
void getDefault (oaByte *value) const

Static Public Methods

oaVarDataAppDef< T > * get (const oaString &name, oaBoolean persist=true)
oaVarDataAppDef< T > * get (const oaString &name, oaUInt4 defSize, const oaByte *defValue, oaBoolean persist=true)
oaVarDataAppDef< T > * get (const oaString &name, const oaAppObjectDef *objDef, oaBoolean persist=true)
oaVarDataAppDef< T > * get (const oaString &name, const oaAppObjectDef *objDef, oaUInt4 defSize, const oaByte *defValue, oaBoolean persist=true)
oaVarDataAppDef< T > * find (const oaString &name)
oaVarDataAppDef< T > * find (const oaString &name, const oaAppObjectDef *objDef)

Detailed Description

template<class T>
class oaVarDataAppDef< T >

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

When the objects are created, a data field is added to each object of the specified dataType. Applications can use the new data field for whatever purpose is necessary.

This type of extension is useful because it allows variable-sized data for each object being extended. This is similar to the oaDataAppDef class, but more general because the data size can differ for each object. (There is a minor speed and size penalty for this additional flexibility.) The default value for this extension is zero bytes.

Note: Because the type of data is unknown to OpenAccess, it is unmanaged. This means the contents are not byte-swapped.

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>
oaVarDataAppDef< T > * oaVarDataAppDef< T >::find const oaString &    name,
const oaAppObjectDef *    objDef
[inline, static]
 

This function returns an oaVarDataAppDef 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>
oaVarDataAppDef< T > * oaVarDataAppDef< T >::find const oaString &    name [inline, static]
 

This function returns an oaVarDataAppDef 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 oaVarDataAppDef< T >::get const T *    object,
oaByte *    value
[inline]
 

This function returns the value of this data extension.

Exceptions:
oacInvalidDesignObjectForAppDef 

template<class T>
oaVarDataAppDef< T > * oaVarDataAppDef< T >::get const oaString &    name,
const oaAppObjectDef *    objDef,
oaUInt4    defSize,
const oaByte *    defValue,
oaBoolean    persist = true
[inline, static]
 

This function constructs an oaVarDataAppDef class variable data extension with the specified name for the specified type of object.

Parameters:
name The name given to the oaVarDataAppDef object
objDef The object extension with which to associate the extension
persist Saves the oaVarDataAppDef data in the database
defSize The default size of the data for this extension
defValue The default value for the data for this extension
Exceptions:
oacAppDefExists 

template<class T>
oaVarDataAppDef< T > * oaVarDataAppDef< T >::get const oaString &    name,
const oaAppObjectDef *    objDef,
oaBoolean    persist = true
[inline, static]
 

This function constructs an oaVarDataAppDef class variable data extension with the specified name for the specified type of object.

Parameters:
name The name given to the oaVarDataAppDef object
objDef The object extension with which to associate the extension
persist Saves the oaVarDataAppDef data in the database
Exceptions:
oacAppDefExists 

template<class T>
oaVarDataAppDef< T > * oaVarDataAppDef< T >::get const oaString &    name,
oaUInt4    defSize,
const oaByte *    defValue,
oaBoolean    persist = true
[inline, static]
 

This function constructs an oaVarDataAppDef class variable data extension with the specified name.

Parameters:
name The name given to the oaVarDataAppDef object
persist Saves the oaVarDataAppDef data in the database
defSize The default size of the data for this extension
defValue The default value for the data for this extension
Exceptions:
oacAppDefExists 

template<class T>
oaVarDataAppDef< T > * oaVarDataAppDef< T >::get const oaString &    name,
oaBoolean    persist = true
[inline, static]
 

This function constructs an oaVarDataAppDef class variable data extension with the specified name.

Parameters:
name The name given to the oaVarDataAppDef object
persist Saves the oaVarDataAppDef data in the database
Exceptions:
oacAppDefExists 

template<class T>
void oaVarDataAppDef< T >::getDefault oaByte *    value const
 

This function fills out the given byte array with the default value for this extension. The byte array should be allocated before calling this function.

Parameters:
value The byte array to be filled out with the default value

template<class T>
oaUInt4 oaVarDataAppDef< T >::getDefaultSize   const
 

This function returns the default size for this extension in bytes.

template<class T>
oaUInt4 oaVarDataAppDef< T >::getSize const T *    object [inline]
 

This function returns the size of the value of this data extension.

Exceptions:
oacInvalidDesignObjectForAppDef 

template<class T>
void oaVarDataAppDef< T >::set T *    object,
oaUInt4    dataSize,
const oaByte *    value
[inline]
 

This function sets the value of this data extension.

Exceptions:
oacInvalidDesignObjectForAppDef 


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

Return to top of page