| Apache Ignite C++

Public Member Functions | List of all members
ignite::binary::BinaryRawReader Class Reference

Binary raw reader. More...

`#include <binary_raw_reader.h>`

## Public Member Functions
| BinaryRawReader (ignite::impl::binary::BinaryReaderImpl *impl)
| Constructor. More...
int8_t | ReadInt8 ()
| Read 8-byte signed integer. More...
int32_t | ReadInt8Array (int8_t *res, int32_t len)
| Read array of 8-byte signed integers. More...
bool | ReadBool ()
| Read bool. More...
int32_t | ReadBoolArray (bool *res, int32_t len)
| Read array of bools. More...
int16_t | ReadInt16 ()
| Read 16-byte signed integer. More...
int32_t | ReadInt16Array (int16_t *res, int32_t len)
| Read array of 16-byte signed integers. More...
uint16_t | ReadUInt16 ()
| Read 16-byte unsigned integer. More...
int32_t | ReadUInt16Array (uint16_t *res, int32_t len)
| Read array of 16-byte unsigned integers. More...
int32_t | ReadInt32 ()
| Read 32-byte signed integer. More...
int32_t | ReadInt32Array (int32_t *res, int32_t len)
| Read array of 32-byte signed integers. More...
int64_t | ReadInt64 ()
| Read 64-byte signed integer. More...
int32_t | ReadInt64Array (int64_t *res, int32_t len)
| Read array of 64-byte signed integers. More...
float | ReadFloat ()
| Read float. More...
int32_t | ReadFloatArray (float *res, int32_t len)
| Read array of floats. More...
double | ReadDouble ()
| Read double. More...
int32_t | ReadDoubleArray (double *res, int32_t len)
| Read array of doubles. More...
Guid | ReadGuid ()
| Read Guid. More...
int32_t | ReadGuidArray (Guid *res, int32_t len)
| Read array of Guids. More...
Date | ReadDate ()
| Read Date. More...
int32_t | ReadDateArray (Date *res, int32_t len)
| Read array of Dates. More...
Timestamp | ReadTimestamp ()
| Read Timestamp. More...
int32_t | ReadTimestampArray (Timestamp *res, int32_t len)
| Read array of Timestamps. More...
Time | ReadTime ()
| Read Time. More...
int32_t | ReadTimeArray (Time *res, int32_t len)
| Read array of Times. More...
int32_t | ReadString (char *res, int32_t len)
| Read string. More...
std::string | ReadString ()
| Read string from the stream. More...
void | ReadString (std::string &dst)
| Read string from the stream. More...
BinaryStringArrayReader | ReadStringArray ()
| Start string array read. More...
BinaryEnumEntry | ReadBinaryEnum ()
| Read enum entry. More...
template<typename T >
BinaryArrayReader< T > | ReadArray ()
| Start array read. More...
template<typename T >
BinaryCollectionReader< T > | ReadCollection ()
| Start collection read. More...
template<typename T , typename OutputIterator >
int32_t | ReadCollection (OutputIterator out)
| Read values and insert them to specified position. More...
template<typename K , typename V >
BinaryMapReader< K, V > | ReadMap ()
| Start map read. More...
CollectionType::Type | ReadCollectionType ()
| Read type of the collection. More...
int32_t | ReadCollectionSize ()
| Read type of the collection. More...
template<typename T >
T | ReadObject ()
| Read object. More...
template<typename T >
T | ReadEnum ()
| Read enum value. More...
template<typename T >
bool | TryReadObject (T &res)
| Try read object. More...

## Detailed Description

Binary raw reader.

This class is implemented as a reference to an implementation so copying of this class instance will only create another reference to the same underlying object.

Note
  User should not store copy of this instance as it can be invalidated as soon as the initially passed to user instance has been destructed. For example this means that if user received an instance of this class as a function argument then he should not store and use copy of this class out of the scope of this function.

## Constructor & Destructor Documentation

## ◆ BinaryRawReader()

ignite::binary::BinaryRawReader::BinaryRawReader | ( | ignite::impl::binary::BinaryReaderImpl * | impl | ) |

Constructor.

Internal method. Should not be used by user.

Parameters

  impl | Implementation.

## Member Function Documentation

## ◆ ReadArray()

template<typename T >

BinaryArrayReader<T> ignite::binary::BinaryRawReader::ReadArray | ( |  | ) |
| inline

Start array read.

Every time you get a BinaryArrayReader from BinaryRawReader you start reading session. Only one single reading session can be open at a time. So it is not allowed to start new reading session until all elements of the collection have been read.

Returns
  Array reader.

## ◆ ReadBinaryEnum()

BinaryEnumEntry ignite::binary::BinaryRawReader::ReadBinaryEnum | ( |  | ) |

Read enum entry.

Returns
  Enum entry.

## ◆ ReadBool()

bool ignite::binary::BinaryRawReader::ReadBool | ( |  | ) |

Read bool.

Maps to "boolean" type in Java.

Returns
  Result.

## ◆ ReadBoolArray()

int32_t ignite::binary::BinaryRawReader::ReadBoolArray | ( | bool * | res,
|  | int32_t | len
| ) |  |

Read array of bools.

Maps to "boolean[]" type in Java.

Parameters

  res | Array to store data to.
  len | Expected length of array.

Returns
  Actual amount of elements read. If "len" argument is less than actual array size or resulting array is set to null, nothing will be written to resulting array and returned value will contain required array length. -1 will be returned in case array in stream was null.

## ◆ ReadCollection() [1/2]

template<typename T >

BinaryCollectionReader<T> ignite::binary::BinaryRawReader::ReadCollection | ( |  | ) |
| inline

Start collection read.

Every time you get a BinaryCollectionReader from BinaryRawReader you start reading session. Only one single reading session can be open at a time. So it is not allowed to start new reading session until all elements of the collection have been read.

Returns
  Collection reader.

## ◆ ReadCollection() [2/2]

template<typename T , typename OutputIterator >

int32_t ignite::binary::BinaryRawReader::ReadCollection | ( | OutputIterator | out | ) |
| inline

Read values and insert them to specified position.

Parameters

  out | Output iterator to the initial position in the destination sequence.

Returns
  Number of elements that have been read.

## ◆ ReadCollectionSize()

int32_t ignite::binary::BinaryRawReader::ReadCollectionSize | ( |  | ) |

Read type of the collection.

Returns
  Collection size.

## ◆ ReadCollectionType()

CollectionType::Type ignite::binary::BinaryRawReader::ReadCollectionType | ( |  | ) |

Read type of the collection.

Returns
  Collection type.

## ◆ ReadDate()

Date ignite::binary::BinaryRawReader::ReadDate | ( |  | ) |

Read Date.

Maps to "java.util.Date" type in Java.

Returns
  Result.

## ◆ ReadDateArray()

int32_t ignite::binary::BinaryRawReader::ReadDateArray | ( | Date * | res,
|  | int32_t | len
| ) |  |

Read array of Dates.

Maps to "java.util.Date[]" type in Java.

Parameters

  res | Array to store data to.
  len | Expected length of array.

Returns
  Actual amount of elements read. If "len" argument is less than actual array size or resulting array is set to null, nothing will be written to resulting array and returned value will contain required array length. -1 will be returned in case array in stream was null.

## ◆ ReadDouble()

double ignite::binary::BinaryRawReader::ReadDouble | ( |  | ) |

Read double.

Maps to "double" type in Java.

Returns
  Result.

## ◆ ReadDoubleArray()

int32_t ignite::binary::BinaryRawReader::ReadDoubleArray | ( | double * | res,
|  | int32_t | len
| ) |  |

Read array of doubles.

Maps to "double[]" type in Java.

Parameters

  res | Array to store data to.
  len | Expected length of array.

Returns
  Actual amount of elements read. If "len" argument is less than actual array size or resulting array is set to null, nothing will be written to resulting array and returned value will contain required array length. -1 will be returned in case array in stream was null.

## ◆ ReadEnum()

template<typename T >

T ignite::binary::BinaryRawReader::ReadEnum | ( |  | ) |
| inline

Read enum value.

Returns
  Enum value.

T Enum type. BinaryEnum class template should be specialized for the type.

## ◆ ReadFloat()

float ignite::binary::BinaryRawReader::ReadFloat | ( |  | ) |

Read float.

Maps to "float" type in Java.

Returns
  Result.

## ◆ ReadFloatArray()

int32_t ignite::binary::BinaryRawReader::ReadFloatArray | ( | float * | res,
|  | int32_t | len
| ) |  |

Read array of floats.

Maps to "float[]" type in Java.

Parameters

  res | Array to store data to.
  len | Expected length of array.

Returns
  Actual amount of elements read. If "len" argument is less than actual array size or resulting array is set to null, nothing will be written to resulting array and returned value will contain required array length. -1 will be returned in case array in stream was null.

## ◆ ReadGuid()

Guid ignite::binary::BinaryRawReader::ReadGuid | ( |  | ) |

Read Guid.

Maps to "java.util.UUID" type in Java.

Returns
  Result.

## ◆ ReadGuidArray()

int32_t ignite::binary::BinaryRawReader::ReadGuidArray | ( | Guid * | res,
|  | int32_t | len
| ) |  |

Read array of Guids.

Maps to "java.util.UUID[]" type in Java.

Parameters

  res | Array to store data to.
  len | Expected length of array.

Returns
  Actual amount of elements read. If "len" argument is less than actual array size or resulting array is set to null, nothing will be written to resulting array and returned value will contain required array length. -1 will be returned in case array in stream was null.

## ◆ ReadInt16()

int16_t ignite::binary::BinaryRawReader::ReadInt16 | ( |  | ) |

Read 16-byte signed integer.

Maps to "short" type in Java.

Returns
  Result.

## ◆ ReadInt16Array()

int32_t ignite::binary::BinaryRawReader::ReadInt16Array | ( | int16_t * | res,
|  | int32_t | len
| ) |  |

Read array of 16-byte signed integers.

Maps to "short[]" type in Java.

Parameters

  res | Array to store data to.
  len | Expected length of array.

Returns
  Actual amount of elements read. If "len" argument is less than actual array size or resulting array is set to null, nothing will be written to resulting array and returned value will contain required array length. -1 will be returned in case array in stream was null.

## ◆ ReadInt32()

int32_t ignite::binary::BinaryRawReader::ReadInt32 | ( |  | ) |

Read 32-byte signed integer.

Maps to "int" type in Java.

Returns
  Result.

## ◆ ReadInt32Array()

int32_t ignite::binary::BinaryRawReader::ReadInt32Array | ( | int32_t * | res,
|  | int32_t | len
| ) |  |

Read array of 32-byte signed integers.

Maps to "int[]" type in Java.

Parameters

  res | Array to store data to.
  len | Expected length of array.

Returns
  Actual amount of elements read. If "len" argument is less than actual array size or resulting array is set to null, nothing will be written to resulting array and returned value will contain required array length. -1 will be returned in case array in stream was null.

## ◆ ReadInt64()

int64_t ignite::binary::BinaryRawReader::ReadInt64 | ( |  | ) |

Read 64-byte signed integer.

Maps to "long" type in Java.

Returns
  Result.

## ◆ ReadInt64Array()

int32_t ignite::binary::BinaryRawReader::ReadInt64Array | ( | int64_t * | res,
|  | int32_t | len
| ) |  |

Read array of 64-byte signed integers.

Maps to "long[]" type in Java.

Parameters

  res | Array to store data to.
  len | Expected length of array.

Returns
  Actual amount of elements read. If "len" argument is less than actual array size or resulting array is set to null, nothing will be written to resulting array and returned value will contain required array length. -1 will be returned in case array in stream was null.

## ◆ ReadInt8()

int8_t ignite::binary::BinaryRawReader::ReadInt8 | ( |  | ) |

Read 8-byte signed integer.

Maps to "byte" type in Java.

Returns
  Result.

## ◆ ReadInt8Array()

int32_t ignite::binary::BinaryRawReader::ReadInt8Array | ( | int8_t * | res,
|  | int32_t | len
| ) |  |

Read array of 8-byte signed integers.

Maps to "byte[]" type in Java.

Parameters

  res | Array to store data to.
  len | Expected length of array.

Returns
  Actual amount of elements read. If "len" argument is less than actual array size or resulting array is set to null, nothing will be written to resulting array and returned value will contain required array length. -1 will be returned in case array in stream was null.

## ◆ ReadMap()

template<typename K , typename V >

BinaryMapReader<K, V> ignite::binary::BinaryRawReader::ReadMap | ( |  | ) |
| inline

Start map read.

Every time you get a BinaryMapReader from BinaryRawReader you start reading session. Only one single reading session can be open at a time. So it is not allowed to start new reading session until all elements of the collection have been read.

Returns
  Map reader.

## ◆ ReadObject()

template<typename T >

T ignite::binary::BinaryRawReader::ReadObject | ( |  | ) |
| inline

Read object.

Returns
  Object.

T Object type. BinaryType class template should be specialized for the type.

## ◆ ReadString() [1/3]

int32_t ignite::binary::BinaryRawReader::ReadString | ( | char * | res,
|  | int32_t | len
| ) |  |

Read string.

Parameters

  res | Array to store data to.
  len | Expected length of string. NULL terminator will be set in case len is greater than real string length.

Returns
  Actual amount of elements read. If "len" argument is less than actual array size or resulting array is set to null, nothing will be written to resulting array and returned value will contain required array length. -1 will be returned in case array in stream was null.

## ◆ ReadString() [2/3]

std::string ignite::binary::BinaryRawReader::ReadString | ( |  | ) |
| inline

Read string from the stream.

Returns
  String.

## ◆ ReadString() [3/3]

void ignite::binary::BinaryRawReader::ReadString | ( | std::string & | dst | ) |
| inline

Read string from the stream.

Parameters

  dst | String.

## ◆ ReadStringArray()

BinaryStringArrayReader ignite::binary::BinaryRawReader::ReadStringArray | ( |  | ) |

Start string array read.

Every time you get a BinaryStringArrayReader from BinaryRawReader you start reading session. Only one single reading session can be open at a time. So it is not allowed to start new reading session until all elements of the collection have been read.

Returns
  String array reader.

## ◆ ReadTime()

Time ignite::binary::BinaryRawReader::ReadTime | ( |  | ) |

Read Time.

Maps to "Time" type in Java.

Returns
  Result.

## ◆ ReadTimeArray()

int32_t ignite::binary::BinaryRawReader::ReadTimeArray | ( | Time * | res,
|  | int32_t | len
| ) |  |

Read array of Times.

Maps to "Time[]" type in Java.

Parameters

  res | Array to store data to.
  len | Expected length of array.

Returns
  Actual amount of elements read. If "len" argument is less than actual array size or resulting array is set to null, nothing will be written to resulting array and returned value will contain required array length. -1 will be returned in case array in stream was null.

## ◆ ReadTimestamp()

Timestamp ignite::binary::BinaryRawReader::ReadTimestamp | ( |  | ) |

Read Timestamp.

Maps to "java.sql.Timestamp" type in Java.

Returns
  Result.

## ◆ ReadTimestampArray()

int32_t ignite::binary::BinaryRawReader::ReadTimestampArray | ( | Timestamp * | res,
|  | int32_t | len
| ) |  |

Read array of Timestamps.

Maps to "java.sql.Timestamp[]" type in Java.

Parameters

  res | Array to store data to.
  len | Expected length of array.

Returns
  Actual amount of elements read. If "len" argument is less than actual array size or resulting array is set to null, nothing will be written to resulting array and returned value will contain required array length. -1 will be returned in case array in stream was null.

## ◆ ReadUInt16()

uint16_t ignite::binary::BinaryRawReader::ReadUInt16 | ( |  | ) |

Read 16-byte unsigned integer.

Maps to "char" type in Java.

Returns
  Result.

## ◆ ReadUInt16Array()

int32_t ignite::binary::BinaryRawReader::ReadUInt16Array | ( | uint16_t * | res,
|  | int32_t | len
| ) |  |

Read array of 16-byte unsigned integers.

Maps to "char[]" type in Java.

Parameters

  res | Array to store data to.
  len | Expected length of array.

Returns
  Actual amount of elements read. If "len" argument is less than actual array size or resulting array is set to null, nothing will be written to resulting array and returned value will contain required array length. -1 will be returned in case array in stream was null.

## ◆ TryReadObject()

template<typename T >

bool ignite::binary::BinaryRawReader::TryReadObject | ( | T & | res | ) |
| inline

Try read object.

Reads value, stores it to res and returns true if the value is not null. Otherwise just returns false.

Parameters

  res | Read value is placed here if non-null.

Returns
  True if the non-null value has been read and false otherwise.

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

- binary_raw_reader.h
- binary_raw_reader.cpp