roo_transport
API Documentation for roo_transport
Loading...
Searching...
No Matches
roo_transport Namespace Reference

Namespaces

namespace  internal
 

Data Structures

class  AsyncUnaryHandler
 
struct  Deserializer
 
struct  Deserializer< bool >
 
struct  Deserializer< int16_t >
 
struct  Deserializer< int32_t >
 
struct  Deserializer< int64_t >
 
struct  Deserializer< int8_t >
 
struct  Deserializer< roo::string_view >
 
struct  Deserializer< std::pair< T1, T2 > >
 
struct  Deserializer< std::tuple< Types... > >
 
struct  Deserializer< uint16_t >
 
struct  Deserializer< uint32_t >
 
struct  Deserializer< uint64_t >
 
struct  Deserializer< uint8_t >
 
struct  Deserializer< Void >
 
class  DynamicSerialized
 Mutable serialized buffer supporting append and random-position writes. More...
 
struct  IntoSerializer
 Default bridge implementing SerializeInto() via serialize(). More...
 
struct  IntoSerializer< T, Itr, Serializer< T >, decltype(std::declval< Serializer< T > >().serializeInto(std::declval< const T & >(), std::declval< Itr & >()), void())>
 Specialization using Serializer<T>::serializeInto() when available. More...
 
class  Link
 
class  LinkMessaging
 
class  LinkTransport
 
class  Messaging
 Abstract interface for message exchange over a reliable channel. More...
 
class  MuxMessaging
 Multiplexes up to 256 logical messaging channels over one Messaging link. More...
 
struct  NullSerialized
 
class  PacketReceiver
 Abstraction for receiving packets produced by PacketSender. More...
 
class  PacketReceiverOverStream
 Receives packets sent by PacketSenderOverStream via a potentially unreliable stream (for example UART/Serial). More...
 
class  PacketSender
 Abstraction for sending packets over an underlying medium. More...
 
class  PacketSenderOverStream
 Sends packets via a potentially unreliable stream (for example UART/Serial) while adding transport framing/integrity metadata. More...
 
class  RequestHandle
 
class  RpcClient
 
class  RpcHeader
 
class  RpcRequest
 
class  RpcServer
 
class  SerializedByteArrayAdapter
 roo::string_view. More...
 
struct  Serializer
 
struct  Serializer< bool >
 bool. More...
 
struct  Serializer< int16_t >
 int16_t. More...
 
struct  Serializer< int32_t >
 int32_t. More...
 
struct  Serializer< int64_t >
 int64_t. More...
 
struct  Serializer< int8_t >
 int8_t. More...
 
struct  Serializer< roo::string_view >
 
struct  Serializer< std::pair< T1, T2 > >
 std::pair<T1, T2>. More...
 
struct  Serializer< std::tuple< Types... > >
 
struct  Serializer< uint16_t >
 uint16_t. More...
 
struct  Serializer< uint32_t >
 uint32_t. More...
 
struct  Serializer< uint64_t >
 uint64_t. More...
 
struct  Serializer< uint8_t >
 uint8_t. More...
 
struct  Serializer< Void >
 Simple serializers/deserializers for basic types are provided below. More...
 
class  SimpleSerialized
 Serialized holder for variable-sized payloads stored on heap. More...
 
class  StaticSerialized
 Serialized holder for small fixed-size payloads. More...
 
class  UnaryHandler
 
class  UnaryStub
 
struct  Void
 

Typedefs

using RpcHandlerFn = std::function< void(RequestHandle handle, const roo::byte *payload, size_t payload_size, bool fin)>
 
using RpcFunctionId = uint32_t
 
using RpcStreamId = uint32_t
 
using FunctionTable = roo_collections::FlatSmallHashMap< RpcFunctionId, RpcHandlerFn >
 

Enumerations

enum  LinkBufferSize {
  kBufferSize256B = 0 , kBufferSize512B = 1 , kBufferSize1KB = 2 , kBufferSize2KB = 3 ,
  kBufferSize4KB = 4 , kBufferSize8KB = 5 , kBufferSize16KB = 6 , kBufferSize32KB = 7 ,
  kBufferSize64KB = 8 , kBufferSize128KB = 9 , kBufferSize256KB = 10 , kBufferSize512KB = 11 ,
  kBufferSize1MB = 12
}
 
enum  LinkStatus { kIdle , kConnecting , kConnected , kBroken }
 
enum  RpcStatus {
  kOk = 0 , kCancelled = 1 , kUnknown = 2 , kInvalidArgument = 3 ,
  kDeadlineExceeded = 4 , kNotFound = 5 , kAlreadyExists = 6 , kPermissionDenied = 7 ,
  kUnauthenticated = 16 , kResourceExhausted = 8 , kFailedPrecondition = 9 , kAborted = 10 ,
  kOutOfRange = 11 , kUnimplemented = 12 , kInternal = 13 , kUnavailable = 14 ,
  kDataLoss = 15
}
 

Functions

template<typename T , typename Itr >
void SerializeInto (const T &val, Itr &output)
 
template<typename T , typename RandomItr >
void SerializeMemberInto (const T &val, RandomItr &result)
 Serializes nested member with 16-bit big-endian length prefix.
 
template<typename T >
constexpr RpcStatus DeserializeMember (const roo::byte *&data, size_t &len, T &result)
 
template<size_t index, typename RandomItr , typename... Types>
constexpr void SerializeTupleRecursive (const std::tuple< Types... > &t, RandomItr &result)
 std::tuple<Types...>.
 
template<size_t index, typename... Types>
constexpr RpcStatus DeserializeTupleRecursive (std::tuple< Types... > &t, const roo::byte *data, size_t len)
 
const charRpcStatusAsString (RpcStatus status)
 
roo_logging::Stream & operator<< (roo_logging::Stream &s, RpcStatus status)
 

Variables

static const uint32_t kPacketOverStreamSeed = 0xB45DF9DE
 

Typedef Documentation

◆ FunctionTable

using roo_transport::FunctionTable = typedef roo_collections::FlatSmallHashMap<RpcFunctionId, RpcHandlerFn>

Definition at line 17 of file server.h.

◆ RpcFunctionId

Definition at line 10 of file rpc.h.

◆ RpcHandlerFn

Definition at line 9 of file handler.h.

◆ RpcStreamId

Definition at line 11 of file rpc.h.

Enumeration Type Documentation

◆ LinkBufferSize

Enumerator
kBufferSize256B 
kBufferSize512B 
kBufferSize1KB 
kBufferSize2KB 
kBufferSize4KB 
kBufferSize8KB 
kBufferSize16KB 
kBufferSize32KB 
kBufferSize64KB 
kBufferSize128KB 
kBufferSize256KB 
kBufferSize512KB 
kBufferSize1MB 

Definition at line 5 of file link_buffer_size.h.

◆ LinkStatus

Enumerator
kIdle 
kConnecting 
kConnected 
kBroken 

Definition at line 5 of file link_status.h.

◆ RpcStatus

Enumerator
kOk 
kCancelled 
kUnknown 
kInvalidArgument 
kDeadlineExceeded 
kNotFound 
kAlreadyExists 
kPermissionDenied 
kUnauthenticated 
kResourceExhausted 
kFailedPrecondition 
kAborted 
kOutOfRange 
kUnimplemented 
kInternal 
kUnavailable 
kDataLoss 

Definition at line 8 of file status.h.

Function Documentation

◆ DeserializeMember()

template<typename T >
constexpr RpcStatus roo_transport::DeserializeMember ( const roo::byte *&  data,
size_t len,
T result 
)
constexpr

◆ DeserializeTupleRecursive()

template<size_t index, typename... Types>
constexpr RpcStatus roo_transport::DeserializeTupleRecursive ( std::tuple< Types... > &  t,
const roo::byte *  data,
size_t  len 
)
constexpr

Definition at line 533 of file serialization.h.

References DeserializeMember(), kInvalidArgument, and kOk.

◆ operator<<()

roo_logging::Stream & roo_transport::operator<< ( roo_logging::Stream &  s,
RpcStatus  status 
)
inline

Definition at line 132 of file status.h.

References RpcStatusAsString().

◆ RpcStatusAsString()

◆ SerializeInto()

template<typename T , typename Itr >
void roo_transport::SerializeInto ( const T val,
Itr output 
)

Definition at line 161 of file serialization.h.

Referenced by SerializeMemberInto().

◆ SerializeMemberInto()

template<typename T , typename RandomItr >
void roo_transport::SerializeMemberInto ( const T val,
RandomItr result 
)

Serializes nested member with 16-bit big-endian length prefix.

Definition at line 429 of file serialization.h.

References kInvalidArgument, kOk, and SerializeInto().

Referenced by roo_transport::Serializer< std::pair< T1, T2 > >::serializeInto(), and SerializeTupleRecursive().

◆ SerializeTupleRecursive()

template<size_t index, typename RandomItr , typename... Types>
constexpr void roo_transport::SerializeTupleRecursive ( const std::tuple< Types... > &  t,
RandomItr result 
)
constexpr

std::tuple<Types...>.

Definition at line 508 of file serialization.h.

References kOk, and SerializeMemberInto().

Variable Documentation

◆ kPacketOverStreamSeed

const uint32_t roo_transport::kPacketOverStreamSeed = 0xB45DF9DE
static

Definition at line 9 of file seed.h.

Referenced by roo_transport::PacketSenderOverStream::send().