----------------------------------------------------------------------------
| 1837 | |
| 1838 | //---------------------------------------------------------------------------- |
| 1839 | int vtkClientServerStream::GetNumberOfValues(int message) const |
| 1840 | { |
| 1841 | if (!this->Internal->Invalid && message >= 0 && message < this->GetNumberOfMessages()) |
| 1842 | { |
| 1843 | if (message + 1 < this->GetNumberOfMessages()) |
| 1844 | { |
| 1845 | // Requested message is not the last message. Use the beginning |
| 1846 | // of the next message to find its length. |
| 1847 | return static_cast<int>( |
| 1848 | this->Internal->MessageIndexes[message + 1] - this->Internal->MessageIndexes[message]); |
| 1849 | } |
| 1850 | else if (this->Internal->StartIndex != vtkClientServerStreamInternals::InvalidStartIndex) |
| 1851 | { |
| 1852 | // Requested message is the last completed message, but there is |
| 1853 | // a partial message in progress. Use the beginning of the next |
| 1854 | // partial message to find this message's length. |
| 1855 | return static_cast<int>(this->Internal->StartIndex - this->Internal->MessageIndexes[message]); |
| 1856 | } |
| 1857 | else |
| 1858 | { |
| 1859 | // Requested message is the last message. Use the length of the |
| 1860 | // value indices array to find the message's length. |
| 1861 | return static_cast<int>( |
| 1862 | this->Internal->ValueOffsets.size() - this->Internal->MessageIndexes[message]); |
| 1863 | } |
| 1864 | } |
| 1865 | else |
| 1866 | { |
| 1867 | return 0; |
| 1868 | } |
| 1869 | } |
| 1870 | |
| 1871 | //---------------------------------------------------------------------------- |
| 1872 | const unsigned char* vtkClientServerStream::GetValue(int message, int value) const |