-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
113 changed files
with
3,961 additions
and
1,872 deletions.
There are no files selected for viewing
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
Submodule oatpp
deleted from
17ef2a
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,27 @@ | ||
#include "pch.h" | ||
#include "bricks.h" | ||
#include "locking_queue.h" | ||
#include "utils.h" | ||
|
||
using namespace bricks; | ||
|
||
void bricks::brick_destroy(brick_t* ptr) { ptr->release(); }; | ||
thread_local std::random_device rd; // Obtain a random number from hardware | ||
thread_local std::mt19937_64 gen(rd()); // Seed the generator (Mersenne Twister for 64-bit numbers) | ||
thread_local std::uniform_int_distribution<uint64_t> distrib(1, UINT64_MAX); // Define the rang | ||
std::mutex mtx; | ||
|
||
void | ||
bricks::brick_destroy(brick_t* ptr) | ||
{ | ||
ptr->release(); | ||
}; | ||
|
||
void | ||
bricks::generate_random_64hex_str(hex64_str_t hex_buffer) | ||
{ | ||
SYNCHRONIZED(mtx); | ||
|
||
int64_t req_handle = distrib(gen); | ||
|
||
snprintf(hex_buffer, 64, "0x%" PRIx64, req_handle); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,5 +6,6 @@ | |
#include "selector.h" | ||
#include "buffer.h" | ||
#include "plugin.h" | ||
#include "meta.h" | ||
|
||
|
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,10 @@ | ||
#pragma once | ||
|
||
#define ASSERT_INITIATED if (!this->initiated) return BRICKS_INVALID_STATE | ||
#define ASSERT_NOT_INITIATED if (this->initiated) return BRICKS_INVALID_STATE | ||
|
||
#define ASSERT_STARTED if (!this->started) return BRICKS_INVALID_STATE | ||
#define ASSERT_NOT_STARTED if (this->started) return BRICKS_INVALID_STATE | ||
#define ASSERT_PREINIT do { if (this->destroyed) return BRICKS_OBJECT_DESTROYED; if ( this->initiated) return BRICKS_INVALID_STATE; } while (false) | ||
#define ASSERT_READY do { if (this->destroyed) return BRICKS_OBJECT_DESTROYED; if (!this->initiated) return BRICKS_INVALID_STATE; } while (false) | ||
|
||
#define BRICKS_MAP_PAIR(x) {#x,x} | ||
|
||
#define SYNCHRONIZED(M) std::lock_guard<std::recursive_mutex> lk__(M); | ||
#define SYNCHRONIZED(M) std::lock_guard lk__(M); | ||
|
||
#define BRICKS_DEFAULT_CLIENT_TIMEOUT 1000 |
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
Oops, something went wrong.