| 1 | |
| 2 | == FDO !LiteralValue !IsNull Support == |
| 3 | |
| 4 | === Overview === |
| 5 | |
| 6 | Right now there are 3 independent !IsNull() methods that are not related to each other (one in !FdoDataValue, one in !FdoGeometryValue, and one in !FdoRaster). |
| 7 | |
| 8 | We can not mix !FdoRaster with !FdoLiteralValue because are two different interfaces and we don’t use them in the same place as !FdoLiteralValue. Instead we can promote !IsNull() function from !FdoDataValue and !FdoGeometryValue to !FdoLiteralValue. |
| 9 | |
| 10 | In this case classes like !FdoCommonFilterExecutor will benefit by this change by calling !IsNull function without care about the type of the object. E.G: |
| 11 | |
| 12 | |
| 13 | {{{ |
| 14 | bool FdoCommonFilterExecutor::IsResultNull () |
| 15 | { |
| 16 | FdoPropertyType propType = GetResultPropertyType(); |
| 17 | if (propType == FdoPropertyType_DataProperty) |
| 18 | return ((FdoDataValue*)m_retvals.back())->IsNull(); |
| 19 | else if (propType == FdoPropertyType_GeometricProperty) |
| 20 | return ((FdoGeometryValue*)m_retvals.back())->IsNull(); |
| 21 | else |
| 22 | throw FdoException::Create(FdoException::NLSGetMessage(UNEXPECTEDERROR)); |
| 23 | } |
| 24 | }}} |
| 25 | |
| 26 | Will become: |
| 27 | |
| 28 | |
| 29 | {{{ |
| 30 | bool FdoCommonFilterExecutor::IsResultNull () |
| 31 | { |
| 32 | return ((FdoLiteralValue*)m_retvals.back())->IsNull(); |
| 33 | } |
| 34 | }}} |
| 35 | |
| 36 | === API Changes === |
| 37 | |
| 38 | !IsNull will be supported by adding the !IsNull() function to !FdoLiteralValue class. |
| 39 | |
| 40 | |
| 41 | {{{ |
| 42 | FDO_API virtual bool FdoLiteralValue::IsNull() = 0; |
| 43 | }}} |