oaDataAppDef Class Template Reference

Inheritance diagram for oaDataAppDef:

oaAppDef oaSessionObject oaObject


Public Methods

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

Static Public Methods

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

Detailed Description

template<class T>
class oaDataAppDef< T >

The oaDataAppDef class implements an application-specific extension on a specified class of managed objects in a database.

A data field is added to each object of the specified dataType when the dataType is created. The default value of the data field is NULL. When an application is created, it can use the new data field for any necessary purpose. This type of extension is useful because it allows an application-defined block of data to be associated with each object.

Note: Since the type of data is unknown to OpenAccess, 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>
oaDataAppDef< T > * oaDataAppDef< T >::find const oaString &    name,
const oaAppObjectDef *    objDef
[inline, static]
 

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

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

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

Parameters:
object The object on which to get the value
value The byte array to fill out with the value

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

This function constructs an oaDataAppDef object, creating a data extension with the specified name and dataSize for the specified type of object.

Parameters:
name The name for the oaDataAppDef object
dataSize The size of each data object, in bytes
defValue The default value for the extension
objDef The object extension with which to associate the extension
persist Saves the oaDataAppDef data in the database
Exceptions:
oacAppDefExists 

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

This function constructs an oaDataAppDef object, creating a data extension with the specified name and dataSize.

Parameters:
name The name given to the oaDataAppDef object
dataSize The size of each data object in bytes
defValue The default value for the extension
persist Saves the oaDataAppDef data in the database
Exceptions:
oacAppDefExists 

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

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

Parameters:
value The byte array to fill out with the value

template<class T>
oaUInt4 oaDataAppDef< T >::getSize   [inline]
 

This function returns the size in bytes of the value for this data extension.

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

This function sets the value of this data extension.

Parameters:
object The object on which to set the value
value The value to store on the object


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

Return to top of page