Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
Classes | Namespaces | Typedefs | Enumerations | Functions | Variables
bytestream.hpp File Reference
#include "shambase/aliases_int.hpp"
#include <sstream>
#include <string>
#include <vector>
+ Include dependency graph for bytestream.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  shambase::details::has_serialize< Container, typename >
 
struct  shambase::details::has_serialize< Container, std::void_t< serialize_t< Container > > >
 
struct  shambase::details::has_deserialize< Container, typename >
 
struct  shambase::details::has_deserialize< Container, std::void_t< deserialize_t< Container > > >
 
class  shambase::details::bytestreamException
 

Namespaces

namespace  shambase
 namespace for basic c++ utilities
 

Typedefs

template<typename T >
using shambase::details::serialize_t = decltype(std::declval< T >().serialize(std::declval< std::basic_stringstream< byte > & >()))
 
template<typename T >
using shambase::details::deserialize_t = decltype(T::deserialize(std::declval< std::basic_stringstream< byte > & >()))
 

Enumerations

enum  VALIDATION_FLAGS { VECTOR = 0x124 }
 

Functions

template<class T >
void shambase::stream_write (std::basic_stringstream< byte > &stream, T &obj)
 
template<class T >
void shambase::stream_read (std::basic_stringstream< byte > &stream, T &obj)
 
void shambase::stream_write_string (std::basic_stringstream< byte > &stream, std::string &s)
 
void shambase::stream_read_string (std::basic_stringstream< byte > &stream, std::string &s)
 
template<class T >
void shambase::stream_write_vector (std::basic_stringstream< byte > &stream, std::vector< T > &vec)
 write the vector into the bytestream
 
template<class T >
void shambase::stream_read_vector (std::basic_stringstream< byte > &stream, std::vector< T > &vec)
 read a vector from the bytestream Note : this appends read objects to the vector without resetting it
 
template<class T >
void shambase::stream_write_vector_trivial (std::basic_stringstream< byte > &stream, std::vector< T > &vec)
 
template<class T >
void shambase::stream_read_vector_trivial (std::basic_stringstream< byte > &stream, std::vector< T > &vec)
 read a vector from the bytestream Note : this appends read objects to the vector without resetting it
 

Variables

template<typename Container >
constexpr bool shambase::details::has_serialize_v = has_serialize<Container>::value
 
template<typename Container >
constexpr bool shambase::details::has_deserialize_v = has_deserialize<Container>::value
 

Detailed Description

Author
Timothée David–Cléris (tim.s.nosp@m.hamr.nosp@m.ock@p.nosp@m.roto.nosp@m.n.me)

Definition in file bytestream.hpp.

Typedef Documentation

◆ deserialize_t

template<typename T >
using shambase::details::deserialize_t = typedef decltype(T::deserialize(std::declval<std::basic_stringstream<byte> &>()))

Definition at line 64 of file bytestream.hpp.

◆ serialize_t

template<typename T >
using shambase::details::serialize_t = typedef decltype(std::declval<T>().serialize( std::declval<std::basic_stringstream<byte> &>()))

Definition at line 51 of file bytestream.hpp.

Enumeration Type Documentation

◆ VALIDATION_FLAGS

enum shambase::details::VALIDATION_FLAGS

Definition at line 77 of file bytestream.hpp.

Variable Documentation

◆ has_deserialize_v

template<typename Container >
constexpr bool shambase::details::has_deserialize_v = has_deserialize<Container>::value
inlineconstexpr

Definition at line 75 of file bytestream.hpp.

◆ has_serialize_v

template<typename Container >
constexpr bool shambase::details::has_serialize_v = has_serialize<Container>::value
inlineconstexpr

Definition at line 61 of file bytestream.hpp.