Inheritance diagram for UnicodeVarCharType:
Public Types | |
typedef uint | Ordinal |
Each type must have a unique positive integer ordinal associated with it. | |
Private Member Functions | |
virtual Ordinal | getOrdinal () const |
| |
virtual uint | getBitCount () const |
| |
virtual uint | getFixedByteCount () const |
| |
virtual uint | getMinByteCount (uint cbMaxWidth) const |
Gets the number of bytes required to store the narrowest value with this type, given a particular max byte count. | |
virtual uint | getAlignmentByteCount (uint cbWidth) const |
Gets the alignment size in bytes required for values of this type, given a particular max byte count. | |
virtual void | visitValue (DataVisitor &dataVisitor, void const *pData, TupleStorageByteLength cbData) const |
Visits a value of this type. | |
virtual int | compareValues (void const *pData1, TupleStorageByteLength cbData1, void const *pData2, TupleStorageByteLength cbData2) const |
Compares two values of this type. |
Definition at line 321 of file StandardTypeDescriptor.cpp.
typedef uint StoredTypeDescriptor::Ordinal [inherited] |
Each type must have a unique positive integer ordinal associated with it.
This is used to reconstruct a StoredTypeDescriptor object from a stored attribute definition.
Definition at line 44 of file StoredTypeDescriptor.h.
virtual Ordinal UnicodeVarCharType::getOrdinal | ( | ) | const [inline, private, virtual] |
Implements StoredTypeDescriptor.
Definition at line 323 of file StandardTypeDescriptor.cpp.
References STANDARD_TYPE_UNICODE_VARCHAR.
00324 { 00325 return STANDARD_TYPE_UNICODE_VARCHAR; 00326 }
virtual uint UnicodeVarCharType::getBitCount | ( | ) | const [inline, private, virtual] |
Implements StoredTypeDescriptor.
Definition at line 328 of file StandardTypeDescriptor.cpp.
virtual uint UnicodeVarCharType::getFixedByteCount | ( | ) | const [inline, private, virtual] |
Implements StoredTypeDescriptor.
Definition at line 333 of file StandardTypeDescriptor.cpp.
virtual uint UnicodeVarCharType::getMinByteCount | ( | uint | cbMaxWidth | ) | const [inline, private, virtual] |
Gets the number of bytes required to store the narrowest value with this type, given a particular max byte count.
For a fixed-width type, the return value is the same as the input.
cbMaxWidth | maximum width for which to compute the minimum |
Implements StoredTypeDescriptor.
Definition at line 338 of file StandardTypeDescriptor.cpp.
virtual uint UnicodeVarCharType::getAlignmentByteCount | ( | uint | cbWidth | ) | const [inline, private, virtual] |
Gets the alignment size in bytes required for values of this type, given a particular max byte count.
This must be 1, 2, 4, or 8, and may not be greater than 2 for variable-width datatypes. For fixed-width datatypes, the width must be a multiple of the alignment size.
cbWidth | width for which to compute the alignment |
Implements StoredTypeDescriptor.
Definition at line 343 of file StandardTypeDescriptor.cpp.
virtual void UnicodeVarCharType::visitValue | ( | DataVisitor & | dataVisitor, | |
void const * | pData, | |||
TupleStorageByteLength | cbData | |||
) | const [inline, private, virtual] |
Visits a value of this type.
dataVisitor | the DataVisitor which should be called with the interpreted value | |
pData | the address of the data value | |
cbData | the number of bytes of data |
Implements StoredTypeDescriptor.
Definition at line 348 of file StandardTypeDescriptor.cpp.
References DataVisitor::visitUnicodeChars().
00352 { 00353 assert((cbData & 1) == 0); 00354 Ucs2ConstBuffer pStr = static_cast<Ucs2ConstBuffer>(pData); 00355 dataVisitor.visitUnicodeChars(pStr,(cbData >> 1)); 00356 }
virtual int UnicodeVarCharType::compareValues | ( | void const * | pData1, | |
TupleStorageByteLength | cbData1, | |||
void const * | pData2, | |||
TupleStorageByteLength | cbData2 | |||
) | const [inline, private, virtual] |
Compares two values of this type.
pData1 | the address of the first data value | |
cbData1 | the width of the first data value in bytes | |
pData2 | the address of the second data value | |
cbData2 | the width of the second data value in bytes |
Implements StoredTypeDescriptor.
Definition at line 358 of file StandardTypeDescriptor.cpp.
References UnicodeCharType::compareStrings(), and min().
00363 { 00364 assert((cbData1 & 1) == 0); 00365 assert((cbData2 & 1) == 0); 00366 Ucs2ConstBuffer pStr1 = static_cast<Ucs2ConstBuffer>(pData1); 00367 Ucs2ConstBuffer pStr2 = static_cast<Ucs2ConstBuffer>(pData2); 00368 TupleStorageByteLength cbMin = std::min(cbData1,cbData2); 00369 uint nCharsMin = (cbMin >> 1); 00370 int rc = UnicodeCharType::compareStrings(pStr1, pStr2, nCharsMin); 00371 if (rc) { 00372 return rc; 00373 } 00374 if (cbData1 == cbData2) { 00375 return 0; 00376 } 00377 Ucs2ConstBuffer trailStart,trailEnd; 00378 if (cbData1 > cbData2) { 00379 trailStart = pStr1 + nCharsMin; 00380 trailEnd = pStr1 + (cbData1 >> 1); 00381 rc = 1; 00382 } else { 00383 trailStart = pStr2 + nCharsMin; 00384 trailEnd = pStr2 + (cbData2 >> 1); 00385 rc = -1; 00386 } 00387 for (; trailStart < trailEnd; trailStart++) { 00388 if (*trailStart != ' ') { 00389 return rc; 00390 } 00391 } 00392 return 0; 00393 }