5 #ifndef ZIO_TENS_H_SEEN 6 #define ZIO_TENS_H_SEEN 17 const char*
type_name(
const std::type_info& t);
19 template<
typename Type>
24 const std::vector<size_t>& shape,
25 size_t word_size,
const char* tn);
33 template<
typename ElementType>
34 void append(
Message& msg,
const ElementType* data,
const std::vector<size_t>& shape) {
35 size_t nbytes =
sizeof(ElementType);
37 for (
auto s : shape) { nbytes *= s; }
39 shape, word,
type_name(
typeid(ElementType)));
57 template<
typename ElementType>
58 const ElementType*
at(
const Message& msg,
size_t index) {
60 if (ret.
empty()) {
return nullptr; }
61 return (
const ElementType*) ret.
data();
const zio::message_t & at(const Message &msg, size_t index)
ZMQ_NODISCARD bool empty() const ZMQ_NOTHROW
void * data() ZMQ_NOTHROW
void append(Message &msg, message_t &&data, const std::vector< size_t > &shape, size_t word_size, const char *tn)
implementation of ZIO data flow protocol endpoints
const char * type_name(const std::type_info &t)