Skip to content

Class radex::IClient

ClassList > radex > IClient

More...

  • #include <client_base.hpp>

Inherited by the following classes: radex::drg::ddict::Client, radex::redis::smartredis::Client

Public Functions

Type Name
virtual bool contains (std::string_view key) = 0
void delete_item (const data::OutgoingHandle & handle)
Delete a typed value and its associated metadata.
virtual detail::BytesBuffer get_bytes (std::string_view key) = 0
std::unique_ptr< detail::ItemInfo > get_item_info_ptr (const data::IncomingHandle & handle)
std::enable_if< data::is_supported_type< T >::value, T >::type get_scalar (const data::IncomingHandle handle)
std::enable_if< data::is_supported_type< T >::value, TensorInfo< T > >::type get_tensor (const data::IncomingHandle & handle)
virtual void put_bytes (std::string_view key, const void * bytes, detail::MetaInt length) = 0
Store raw bytes under key , overwriting any existing value.
std::enable_if< data::is_supported_type< T >::value, void >::type put_scalar (const data::OutgoingHandle & handle, const T & value)
std::enable_if< data::is_supported_type< T >::value, void >::type put_tensor (const data::OutgoingHandle & handle, const std::vector< detail::MetaInt > & dims, const std::vector< T > & data)
std::enable_if< data::is_supported_type< T >::value, void >::type put_tensor (const data::OutgoingHandle & handle, const detail::MetaInt * dims, detail::MetaInt n_dims, const T * elements, detail::MetaInt n_elements)
virtual detail::BytesBuffer wait_for_bytes (std::string_view key, std::chrono::milliseconds timeout) = 0
std::unique_ptr< detail::ItemInfo > wait_for_item_info_ptr (const data::IncomingHandle & handle, std::chrono::milliseconds timeout)
std::enable_if< data::is_supported_type< T >::value, T >::type wait_for_scalar (const data::IncomingHandle handle, std::chrono::milliseconds timeout)
std::enable_if< data::is_supported_type< T >::value, TensorInfo< T > >::type wait_for_tensor (const data::IncomingHandle & handle, std::chrono::milliseconds timeout)
virtual ~IClient ()

Detailed Description

Abstract base class for all RaDex backend clients (Dragon, SmartRedis, ...).

Provides typed put_scalar/get_scalar/put_tensor/get_tensor (and their wait_for_* blocking variants) on top of the raw byte-oriented put_bytes/get_bytes/wait_for_bytes methods that concrete backends implement.

Public Functions Documentation

function contains

virtual bool radex::IClient::contains (
    std::string_view key
) = 0

Returns:

True if key exists in the backing store.


function delete_item

Delete a typed value and its associated metadata.

void radex::IClient::delete_item (
    const data::OutgoingHandle & handle
) 


function get_bytes

virtual detail::BytesBuffer radex::IClient::get_bytes (
    std::string_view key
) = 0

Returns:

The raw bytes previously stored under key.


function get_item_info_ptr

std::unique_ptr< detail::ItemInfo > radex::IClient::get_item_info_ptr (
    const data::IncomingHandle & handle
) 

function get_scalar

template<typename T>
inline std::enable_if< data::is_supported_type < T >::value, T >::type radex::IClient::get_scalar (
    const data::IncomingHandle handle
) 

Returns:

The scalar value previously written under handle.

Exception:

  • std::runtime_error If the stored value is a tensor, or its type does not match T.

function get_tensor

template<typename T>
inline std::enable_if< data::is_supported_type < T >::value, TensorInfo < T > >::type radex::IClient::get_tensor (
    const data::IncomingHandle & handle
) 

Returns:

The tensor previously written under handle.

Exception:

  • std::runtime_error If the stored value is a scalar, or its type does not match T.

function put_bytes

Store raw bytes under key , overwriting any existing value.

virtual void radex::IClient::put_bytes (
    std::string_view key,
    const void * bytes,
    detail::MetaInt length
) = 0


function put_scalar

template<typename T>
inline std::enable_if< data::is_supported_type < T >::value, void >::type radex::IClient::put_scalar (
    const data::OutgoingHandle & handle,
    const T & value
) 

Store a scalar value under handle.

Template parameters:

  • T One of int32_t, int64_t, float, double.

function put_tensor [½]

template<typename T>
inline std::enable_if< data::is_supported_type < T >::value, void >::type radex::IClient::put_tensor (
    const data::OutgoingHandle & handle,
    const std::vector< detail::MetaInt > & dims,
    const std::vector< T > & data
) 

Store a tensor under handle.

Parameters:

  • dims The tensor's dimensions, outermost first.
  • data The tensor's elements in row-major (C) order.

function put_tensor [2/2]

template<typename T>
inline std::enable_if< data::is_supported_type < T >::value, void >::type radex::IClient::put_tensor (
    const data::OutgoingHandle & handle,
    const detail::MetaInt * dims,
    detail::MetaInt n_dims,
    const T * elements,
    detail::MetaInt n_elements
) 

Store a tensor under handle, given raw dimension/element pointers.

Parameters:

  • dims Pointer to n_dims dimension sizes, outermost first.
  • elements Pointer to n_elements elements in row-major order.

function wait_for_bytes

virtual detail::BytesBuffer radex::IClient::wait_for_bytes (
    std::string_view key,
    std::chrono::milliseconds timeout
) = 0

Block until key becomes available, then return its raw bytes.

Parameters:

  • timeout Maximum time to wait for the key to appear.

function wait_for_item_info_ptr

std::unique_ptr< detail::ItemInfo > radex::IClient::wait_for_item_info_ptr (
    const data::IncomingHandle & handle,
    std::chrono::milliseconds timeout
) 

function wait_for_scalar

template<typename T>
inline std::enable_if< data::is_supported_type < T >::value, T >::type radex::IClient::wait_for_scalar (
    const data::IncomingHandle handle,
    std::chrono::milliseconds timeout
) 

Block until a scalar value is available under handle, then return it.

Parameters:

  • timeout Maximum time to wait for the value to appear.

function wait_for_tensor

template<typename T>
inline std::enable_if< data::is_supported_type < T >::value, TensorInfo < T > >::type radex::IClient::wait_for_tensor (
    const data::IncomingHandle & handle,
    std::chrono::milliseconds timeout
) 

Block until a tensor is available under handle, then return it.

Parameters:

  • timeout Maximum time to wait for the value to appear.

function ~IClient

inline virtual radex::IClient::~IClient () 


The documentation for this class was generated from the following file include/radex/client_base.hpp