Hazelcast C++ Client
Public Member Functions | List of all members
hazelcast::client::serialization::portable_reader Class Reference

Provides a mean of reading portable fields from a binary in form of java primitives arrays of java primitives , nested portable fields and array of portable fields. More...

#include <serialization.h>

Public Member Functions

 portable_reader (pimpl::PortableSerializer &portable_ser, object_data_input &data_input, const std::shared_ptr< ClassDefinition > &cd, bool is_default_reader)
 
template<typename T >
std::enable_if< std::is_same< int16_t, typename std::remove_cv< T >::type >::value||std::is_same< int32_t, typename std::remove_cv< T >::type >::value||std::is_same< int64_t, typename std::remove_cv< T >::type >::value||std::is_same< float, typename std::remove_cv< T >::type >::value||std::is_same< double, typename std::remove_cv< T >::type >::value||std::is_same< byte, typename std::remove_cv< T >::type >::value||std::is_same< char, typename std::remove_cv< T >::type >::value||std::is_same< char16_t, typename std::remove_cv< T >::type >::value||std::is_same< bool, typename std::remove_cv< T >::type >::value||std::is_same< std::string, typename std::remove_cv< T >::type >::value, T >::type read (const std::string &field_name)
 
template<typename T >
std::enable_if< std::is_same< std::vector< byte >, typename std::remove_cv< T >::type >::value||std::is_same< std::vector< char >, typename std::remove_cv< T >::type >::value||std::is_same< std::vector< bool >, typename std::remove_cv< T >::type >::value||std::is_same< std::vector< int16_t >, typename std::remove_cv< T >::type >::value||std::is_same< std::vector< int32_t >, typename std::remove_cv< T >::type >::value||std::is_same< std::vector< int64_t >, typename std::remove_cv< T >::type >::value||std::is_same< std::vector< float >, typename std::remove_cv< T >::type >::value||std::is_same< std::vector< double >, typename std::remove_cv< T >::type >::value||std::is_same< std::vector< std::string >, typename std::remove_cv< T >::type >::value, boost::optional< T > >::type read (const std::string &field_name)
 
template<typename T >
boost::optional< T > read_portable (const std::string &field_name)
 
template<typename T >
boost::optional< std::vector< T > > read_portable_array (const std::string &field_name)
 
object_data_inputget_raw_data_input ()
 
void end ()
 Internal Api. More...
 

Detailed Description

Provides a mean of reading portable fields from a binary in form of java primitives arrays of java primitives , nested portable fields and array of portable fields.

Member Function Documentation

◆ end()

void hazelcast::client::serialization::portable_reader::end ( )

Internal Api.

Should not be called by end user.

◆ get_raw_data_input()

object_data_input & hazelcast::client::serialization::portable_reader::get_raw_data_input ( )
See also
PortableWriter::getRawDataOutput

Note that portable fields can not read after getRawDataInput() is called. In case this happens, io will be thrown.

Returns
rawDataInput
Exceptions
io_exception

◆ read() [1/2]

template<typename T >
std::enable_if<std::is_same<int16_t, typename std::remove_cv<T>::type>::value || std::is_same<int32_t, typename std::remove_cv<T>::type>::value || std::is_same<int64_t, typename std::remove_cv<T>::type>::value || std::is_same<float, typename std::remove_cv<T>::type>::value || std::is_same<double, typename std::remove_cv<T>::type>::value || std::is_same<byte, typename std::remove_cv<T>::type>::value || std::is_same<char, typename std::remove_cv<T>::type>::value || std::is_same<char16_t, typename std::remove_cv<T>::type>::value || std::is_same<bool, typename std::remove_cv<T>::type>::value || std::is_same<std::string, typename std::remove_cv<T>::type>::value, T>::type hazelcast::client::serialization::portable_reader::read ( const std::string &  field_name)
inline
Parameters
fieldNamename of the field
Returns
the value read

◆ read() [2/2]

template<typename T >
std::enable_if<std::is_same<std::vector<byte>, typename std::remove_cv<T>::type>::value || std::is_same<std::vector<char>, typename std::remove_cv<T>::type>::value || std::is_same<std::vector<bool>, typename std::remove_cv<T>::type>::value || std::is_same<std::vector<int16_t>, typename std::remove_cv<T>::type>::value || std::is_same<std::vector<int32_t>, typename std::remove_cv<T>::type>::value || std::is_same<std::vector<int64_t>, typename std::remove_cv<T>::type>::value || std::is_same<std::vector<float>, typename std::remove_cv<T>::type>::value || std::is_same<std::vector<double>, typename std::remove_cv<T>::type>::value || std::is_same<std::vector<std::string>, typename std::remove_cv<T>::type>::value, boost::optional<T> >::type hazelcast::client::serialization::portable_reader::read ( const std::string &  field_name)
inline
Parameters
fieldNamename of the field
Returns
the value read

◆ read_portable()

template<typename T >
boost::optional< T > hazelcast::client::serialization::portable_reader::read_portable ( const std::string &  field_name)
Template Parameters
typeof the portable class
Parameters
fieldNamename of the field
Returns
the portable value read

◆ read_portable_array()

template<typename T >
boost::optional< std::vector< T > > hazelcast::client::serialization::portable_reader::read_portable_array ( const std::string &  field_name)
Template Parameters
typeof the portable class in array
Parameters
fieldNamename of the field
Returns
the portable array value read
Template Parameters
typeof the portable class in array
Parameters
fieldNamename of the field
Returns
the portable array value read
Exceptions
io_exception

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