summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-08-03 20:03:31 +0100
committerAmlal El Mahrouss <amlal@nekernel.org>2025-08-03 20:03:31 +0100
commit989d015f105ada9e0c0d2ba43c9e18010ec13385 (patch)
treed2beb0b33e78486679a718f36a0c561f0142a4a8
parent4b4d6299d28467b9c234e40004bae1d40b37b0dc (diff)
feat! replace deliver_modem with basic_delivery_modem, add checks for pointer too.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
-rw-r--r--README.md2
-rw-r--r--dev/lib/except/error.hpp2
-rw-r--r--dev/lib/fix/network.hpp23
-rw-r--r--dev/lib/fix/parser.hpp2
-rw-r--r--dev/lib/io/print.hpp2
-rw-r--r--dev/lib/logic/equiv.hpp2
-rw-r--r--dev/lib/logic/math.hpp2
-rw-r--r--dev/lib/logic/opt.hpp2
-rw-r--r--dev/lib/memory/tracked_ptr.hpp2
-rw-r--r--dev/lib/utility/cgi.hpp2
-rw-r--r--dev/lib/utility/crc32.hpp2
-rw-r--r--dev/lib/utility/embfs.hpp2
-rw-r--r--dev/tests/fix_basic/fix_test.cc2
-rw-r--r--dev/tests/tracked_ptr_basic/tracked_ptr_test.cc2
-rw-r--r--dev/tests/tracked_ptr_leak/tracked_ptr_test.cc2
15 files changed, 28 insertions, 23 deletions
diff --git a/README.md b/README.md
index 8d15f86..bdee118 100644
--- a/README.md
+++ b/README.md
@@ -23,4 +23,4 @@ int main(int argc, char** argv)
}
```
-##### (c) 2025 SNU Systems, Corp all rights reserved. \ No newline at end of file
+##### (c) 2025 SNU Systems, Corp. \ No newline at end of file
diff --git a/dev/lib/except/error.hpp b/dev/lib/except/error.hpp
index 9e16ad0..6e75f16 100644
--- a/dev/lib/except/error.hpp
+++ b/dev/lib/except/error.hpp
@@ -1,7 +1,7 @@
/*
* File: opt.hpp
* Author: Amlal El Mahrouss,
- * Copyright 2023-2025, Amlal El Mahrouss/SNU Systems Corp all rights reserved.
+ * Copyright 2023-2025, Amlal El Mahrouss/SNU Systems Corp.
*/
#ifndef _SNU_ERR_HPP
diff --git a/dev/lib/fix/network.hpp b/dev/lib/fix/network.hpp
index e663869..9b08b5c 100644
--- a/dev/lib/fix/network.hpp
+++ b/dev/lib/fix/network.hpp
@@ -2,7 +2,7 @@
* File: fix/network.hpp
* Purpose: Financial Information Exchange in C++
* Author: Amlal El Mahrouss (founder@snu.systems)
- * Copyright 2025, Amlal El Mahrouss and SNU Systems Corp all rights reserved.
+ * Copyright 2025, Amlal El Mahrouss and SNU Systems Corp.
*/
#ifndef _SNU_FIX_NETWORK_HPP
@@ -10,23 +10,24 @@
#include <arpa/inet.h>
#include <sys/socket.h>
+#include <utility>
#include <cstddef>
namespace snu::fix
{
- class delivery_modem;
+ class basic_delivery_modem;
typedef int32_t delivery_socket_type;
/// @brief a delivery modem is a container which establishes a comm. channel between the FIX session and application.
- class delivery_modem final
+ class basic_delivery_modem final
{
public:
- explicit delivery_modem() = default;
- ~delivery_modem() = default;
+ explicit basic_delivery_modem() = default;
+ ~basic_delivery_modem() = default;
- delivery_modem& operator=(const delivery_modem&) = default;
- delivery_modem(const delivery_modem&) = default;
+ basic_delivery_modem& operator=(const basic_delivery_modem&) = default;
+ basic_delivery_modem(const basic_delivery_modem&) = default;
public:
static constexpr auto local_address = "127.0.0.1";
@@ -38,6 +39,8 @@ namespace snu::fix
template <typename T>
bool receive(T& out, std::size_t len) noexcept
{
+ static_assert(std::is_pointer<T>::value, "T is not a pointer!");
+
if (!out)
return false;
@@ -52,6 +55,8 @@ namespace snu::fix
template <typename T>
bool transmit(T& out, std::size_t len) noexcept
{
+ static_assert(std::is_pointer<T>::value, "T is not a pointer!");
+
if (!out)
return false;
@@ -64,7 +69,7 @@ namespace snu::fix
}
template <int32_t AF, int32_t Kind, int32_t IPProto, int32_t Port>
- bool construct(const char* addr = delivery_modem::local_address, const bool& is_server = false) noexcept
+ bool construct(const char* addr = basic_delivery_modem::local_address, const bool& is_server = false) noexcept
{
static_assert(AF != 0, "AF is zero");
static_assert(Kind != 0, "Kind is zero");
@@ -88,7 +93,7 @@ namespace snu::fix
return ret == 0;
}
- ::listen(fd_, delivery_modem::backlog_count);
+ ::listen(fd_, basic_delivery_modem::backlog_count);
return true;
}
diff --git a/dev/lib/fix/parser.hpp b/dev/lib/fix/parser.hpp
index a195eb3..5701783 100644
--- a/dev/lib/fix/parser.hpp
+++ b/dev/lib/fix/parser.hpp
@@ -2,7 +2,7 @@
* File: fix/parser.hpp
* Purpose: Financial Information Exchange parser in C++
* Author: Amlal El Mahrouss (founder@snu.systems)
- * Copyright 2025, Amlal El Mahrouss and SNU Systems Corp all rights reserved.
+ * Copyright 2025, Amlal El Mahrouss and SNU Systems Corp.
*/
#ifndef _SNU_FIX_PARSER_HPP
diff --git a/dev/lib/io/print.hpp b/dev/lib/io/print.hpp
index 8656214..e326845 100644
--- a/dev/lib/io/print.hpp
+++ b/dev/lib/io/print.hpp
@@ -2,7 +2,7 @@
* File: print.hpp
* Purpose: SNU Print library
* Author: Amlal El Mahrouss. (founder@snu.systems)
- * Copyright 2025, SNU Systems Corp all rights reserved.
+ * Copyright 2025, SNU Systems Corp.
*/
#ifndef _SNU_PRINT_HPP
diff --git a/dev/lib/logic/equiv.hpp b/dev/lib/logic/equiv.hpp
index 4bb5904..2f63673 100644
--- a/dev/lib/logic/equiv.hpp
+++ b/dev/lib/logic/equiv.hpp
@@ -2,7 +2,7 @@
* File: equiv.hpp
* Purpose: Equivalence runtime c++ header.
* Author: Amlal El Mahrouss (founder@snu.systems)
- * Copyright 2025, Amlal El Mahrouss and SNU Systems Corp all rights reserved.
+ * Copyright 2025, Amlal El Mahrouss and SNU Systems Corp.
*/
#pragma once
diff --git a/dev/lib/logic/math.hpp b/dev/lib/logic/math.hpp
index 3ea99dc..cab995a 100644
--- a/dev/lib/logic/math.hpp
+++ b/dev/lib/logic/math.hpp
@@ -2,7 +2,7 @@
* File: math.hpp
* Purpose: Mathematics c++ header.
* Author: Amlal El Mahrouss (founder@snu.systems)
- * Copyright 2025, Amlal El Mahrouss all rights reserved.
+ * Copyright 2025, Amlal El Mahrouss.
*/
#pragma once
diff --git a/dev/lib/logic/opt.hpp b/dev/lib/logic/opt.hpp
index d4bb73c..a8e66b4 100644
--- a/dev/lib/logic/opt.hpp
+++ b/dev/lib/logic/opt.hpp
@@ -1,7 +1,7 @@
/*
* File: opt.hpp
* Author: Amlal El Mahrouss,
- * Copyright 2023-2025, Amlal El Mahrouss/SNU Systems Corp all rights reserved.
+ * Copyright 2023-2025, Amlal El Mahrouss/SNU Systems Corp.
*/
#ifndef _SNU_OPT_HPP
diff --git a/dev/lib/memory/tracked_ptr.hpp b/dev/lib/memory/tracked_ptr.hpp
index 61ad685..2607b5b 100644
--- a/dev/lib/memory/tracked_ptr.hpp
+++ b/dev/lib/memory/tracked_ptr.hpp
@@ -2,7 +2,7 @@
* File: memory/tracked_ptr.hpp
* Purpose: Custom smart pointer implementation in C++
* Author: Amlal El Mahrouss (founder@snu.systems)
- * Copyright 2025, Amlal El Mahrouss and SNU Systems Corp all rights reserved.
+ * Copyright 2025, Amlal El Mahrouss and SNU Systems Corp.
*/
#pragma once
diff --git a/dev/lib/utility/cgi.hpp b/dev/lib/utility/cgi.hpp
index bae31b8..8e2170e 100644
--- a/dev/lib/utility/cgi.hpp
+++ b/dev/lib/utility/cgi.hpp
@@ -1,7 +1,7 @@
/*
* File: cgi.hpp
* Author: Amlal El Mahrouss,
- * Copyright 2023-2025, Amlal El Mahrouss all rights reserved.
+ * Copyright 2023-2025, Amlal El Mahrouss.
*/
#ifndef _SNU_CGI_HPP
diff --git a/dev/lib/utility/crc32.hpp b/dev/lib/utility/crc32.hpp
index fe9f770..f7e5fc9 100644
--- a/dev/lib/utility/crc32.hpp
+++ b/dev/lib/utility/crc32.hpp
@@ -2,7 +2,7 @@
* File: crc32.hpp
* Purpose: CRC32 module.
* Author: Amlal El Mahrouss,
- * Copyright 2025, Amlal El Mahrouss all rights reserved.
+ * Copyright 2025, Amlal El Mahrouss.
*/
#ifndef _SNU_CRC32_HPP
diff --git a/dev/lib/utility/embfs.hpp b/dev/lib/utility/embfs.hpp
index 7d73d62..fea379c 100644
--- a/dev/lib/utility/embfs.hpp
+++ b/dev/lib/utility/embfs.hpp
@@ -2,7 +2,7 @@
* File: embfs.hpp
* Purpose: Embedded File System.
* Author: Amlal El Mahrouss (founder@snu.systems)
- * Copyright 2025, Amlal El Mahrouss all rights reserved.
+ * Copyright 2025, Amlal El Mahrouss.
*/
#ifndef _SNU_EMBFS_HPP
diff --git a/dev/tests/fix_basic/fix_test.cc b/dev/tests/fix_basic/fix_test.cc
index 08f435c..1ce128f 100644
--- a/dev/tests/fix_basic/fix_test.cc
+++ b/dev/tests/fix_basic/fix_test.cc
@@ -2,7 +2,7 @@
* File: tests/tracked_ptr_test.cc
* Purpose: Custom smart pointer unit tests in C++
* Author: Amlal El Mahrouss (founder@snu.systems)
- * Copyright 2025, Amlal El Mahrouss and SNU Systems Corp all rights reserved.
+ * Copyright 2025, Amlal El Mahrouss and SNU Systems Corp.
*/
#include <lib/fix/parser.hpp>
diff --git a/dev/tests/tracked_ptr_basic/tracked_ptr_test.cc b/dev/tests/tracked_ptr_basic/tracked_ptr_test.cc
index 462ec5f..0e72e77 100644
--- a/dev/tests/tracked_ptr_basic/tracked_ptr_test.cc
+++ b/dev/tests/tracked_ptr_basic/tracked_ptr_test.cc
@@ -2,7 +2,7 @@
* File: tests/tracked_ptr_test.cc
* Purpose: Custom smart pointer unit tests in C++
* Author: Amlal El Mahrouss (founder@snu.systems)
- * Copyright 2025, Amlal El Mahrouss and SNU Systems Corp all rights reserved.
+ * Copyright 2025, Amlal El Mahrouss and SNU Systems Corp.
*/
#include <lib/memory/tracked_ptr.hpp>
diff --git a/dev/tests/tracked_ptr_leak/tracked_ptr_test.cc b/dev/tests/tracked_ptr_leak/tracked_ptr_test.cc
index f583938..6818b7c 100644
--- a/dev/tests/tracked_ptr_leak/tracked_ptr_test.cc
+++ b/dev/tests/tracked_ptr_leak/tracked_ptr_test.cc
@@ -2,7 +2,7 @@
* File: tests/tracked_ptr_test.cc
* Purpose: Custom smart pointer unit tests in C++
* Author: Amlal El Mahrouss (founder@snu.systems)
- * Copyright 2025, Amlal El Mahrouss and SNU Systems Corp all rights reserved.
+ * Copyright 2025, Amlal El Mahrouss and SNU Systems Corp.
*/
#include <lib/memory/tracked_ptr.hpp>