Public Methods | |
oa1DLookupTbl () | |
oa1DLookupTbl (const oa1DLookupTbl< T, U > &tbl) | |
oa1DLookupTbl (oaUInt4 numItemsIn, const oaString &nameIn, U defaultValue, oaInterpolateType iTypeIn=oacSnapDownInterpolateType, oaExtrapolateType eLowerTypeIn=oacSnapUpExtrapolateType, oaExtrapolateType eUpperTypeIn=oacSnapDownExtrapolateType) | |
~oa1DLookupTbl () | |
oa1DLookupTbl< T, U > & | operator= (const oa1DLookupTbl< T, U > &tbl) |
oaUInt4 | getNumItems () const |
void | getName (oaString &nameOut) const |
const oaString & | getName () const |
oaInterpolateType | getInterpolateType () const |
oaExtrapolateType | getLowerExtrapolateType () const |
oaExtrapolateType | getUpperExtrapolateType () const |
U | getDefaultValue () const |
T | getHeader (oaUInt4 index) const |
U | getValue (oaUInt4 index) const |
U | find (T key) const |
void | setNumItems (oaUInt4 numItemsIn) |
void | setName (const oaString &nameIn) |
void | setInterpolateType (oaInterpolateType type) |
void | setLowerExtrapolateType (oaExtrapolateType type) |
void | setUpperExtrapolateType (oaExtrapolateType type) |
void | setDefaultValue (U value) |
void | setHeader (oaUInt4 index, T value) |
void | setValue (oaUInt4 index, U value) |
oaBoolean | operator== (const oa1DLookupTbl< T, U > &name) const |
oaBoolean | operator!= (const oa1DLookupTbl< T, U > &name) const |
oaUInt8 | calcVMSize () const |
The class is templatized for both the type of the header and the return value entries. At the time that a lookup is performed, the header entries are assumed to be in strictly ascending order. The entries can be out of order while the table is being created or modified.
The handling of keys that are not exact header entries is determined by the interpolation and extrapolation types set in the table. Interpolation applies to keys that are within the range of the header entries, and extrapolation applies to keys that are outside of the range of the header entries. (Note that the table has one extrapolation type set for values below the lowest header entry, and a different extrapolation type set for values above the highest header entry.)
See the classes oaExtrapolateType and oaInterpolateType for more details.
The lookup classes (oa1DLookupTbl and oa2DLookupTbl) are used by OpenAccess to represent values passed to oaValue subclasses -- see oaInt1DTblValue, oaDualInt1DTblValue, oaFlt1DTblValue, oaIntFltTblValue, oaFltIntFltTblValue, and oaAntennaRatioValue for examples of oaValue subclasses that use oa1DLookupTbls. The oaValue subclasses, in turn, are used to associate different values with constraints -- see oaValue() and its subclasses for more information. The oa1DLookupTbl utility class can be used by applications for other purposes as well.
The following example shows an oa1DLookupTbl<oaUInt4, oaFloat> table and demonstrates how a look up key of 12 is interpolated.
The next example shows the same table and demonstrates how a look up key of 7 or 8 is interpolated using the oacInclusiveSnapDownInterpolateType enum.
Consider the look up of a key that is outside of the range of the table, such as a key of 20. The following example uses the same 1D look up table to demonstrate how values outside of the range are extrapolated.
|
This function constructs an empty oa1DLookupTbl instance to provide a one-dimensional lookup table. The table has a 0 allocated size at this point. oa1DLookupTbl::setNumItems must be called before it can be used. |
|
This function constructs an oa1DLookupTbl instance and initializes the table to the values in the argument oa1DLookupTbl tbl.
|
|
This function constructs an oa1DLookupTbl instance using the specified values to provide a template for a one-dimensional lookup table.
|
|
This function destroys this oa1DLookupTbl class and all data associated with the table. |
|
This utility function returns the number of bytes this object uses in virtual memory. |
|
This function returns a value based on the specified header key. If the key is not present in the table, the value is interpolated or extrapolated.
|
|
This function returns the default value of this table. |
|
This function returns a header value for this table. The index must be legal for this table.
|
|
This function returns the interpolation type of the table. |
|
This function returns the lower extrapolation type of the table. |
|
This function returns the name of this table. |
|
This function returns the name of this table.
|
|
This function returns the allocated size of this table. |
|
This function returns the upperExtrapolation type of the table. |
|
This function gets a return value contained in this table. The index must be legal for this table.
|
|
This function compares this oa1DLookupTbl lookup table with the specified oa1DLookupTbl table. If they are not equal, true is returned; otherwise, false.
|
|
This is the deep assignment operator for the oa1DLookupTbl. Table attributes and values are copied from the specified oa1DLookupTbl to this table.
|
|
This function compares this oa1DLookupTbl lookup table with the specified oa1DLookupTbl table. If they are equal, true is returned; otherwise, false.
|
|
This function sets the default value of this table to the specified value.
|
|
This function sets a header value in this table.
|
|
This function sets the interpolation type of this table. |
|
This function sets the extrapolation type of this table for keys that are below all the header values.
|
|
This function sets the name of this table to the specified name.
|
|
This function sets the allocated size of this table. The previous values will be maintained in the new table if there is room. If the new size is smaller than the previous size then some of the old values will be discarded. If the new size is larger than the previous size then the previous values will still be present in the same index locations.
|
|
This function sets the extrapolation type of this table for keys that are above all the header values.
|
|
This function sets a return value in this table. The index must be legal for this table.
|
Copyright © 2002 - 2010 Cadence Design Systems, Inc.
All Rights Reserved.