This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Source: https://aensidhe.ru/blog/readonlyspan-readonlysequence-c++ | |
template<class TElement> | |
class Parser { | |
private: | |
const IMsgPackParser<TElement> elementParser_; | |
template<template<class> Container> | |
void Read(const Container<byte> & source, Span<TElement> & array, size_t & readSize) { | |
for(size_t i = 0u; i != array.Length(); ++i) { | |
size_t temp; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <dining_philosophers/common/fork_messages.hpp> | |
#include <dining_philosophers/common/random_generator.hpp> | |
#include <dining_philosophers/csp_based/trace_maker/all.hpp> | |
#include <fmt/format.h> | |
void fork_process( | |
so_5::mchain_t fork_ch ) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <dining_philosophers/common/fork_messages.hpp> | |
#include <dining_philosophers/common/random_generator.hpp> | |
#include <dining_philosophers/csp_based/trace_maker/all.hpp> | |
#include <fmt/format.h> | |
#include <queue> | |
void fork_process( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
enum class msg_count_status_t | |
{ | |
undefined, | |
defined | |
}; | |
struct basic_data_t | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
enum class msg_count_status_t | |
{ | |
undefined, | |
defined | |
}; | |
struct basic_data_t | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*! | |
* \file | |
* \brief Implementation of Asio's Thread Pool dispatcher. | |
* | |
* \since | |
* v.1.0.2 | |
*/ | |
#pragma once |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template< typename Payload, typename Envelope > | |
class basic_message_holder_impl_t | |
{ | |
protected : | |
intrusive_ptr_t< Envelope > m_msg; | |
public : | |
using payload_type = Payload; | |
using envelope_type = Envelope; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <restinio/all.hpp> | |
#include <so_5/all.hpp> | |
#include <random> | |
// Message for transfer requests from RESTinio's thread to processing thread. | |
struct handle_request | |
{ | |
restinio::request_handle_t m_req; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <restinio/all.hpp> | |
#include <restinio/helpers/http_field_parsers/content-type.hpp> | |
#include <fmt/format.h> | |
using router_t = restinio::router::express_router_t<>; | |
auto handle_post_body( | |
const restinio::request_handle_t & req ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <chrono> | |
#include <condition_variable> | |
#include <iostream> | |
#include <mutex> | |
#include <thread> | |
using namespace std::chrono; | |
struct lock_context | |
{ |
OlderNewer