Skip to content

Commit 4be2e1f

Browse files
authored
Function Pointer Implementation
Initial function pointer implementation; Incomplete documentation
2 parents d931165 + 44c904d commit 4be2e1f

27 files changed

Lines changed: 1292 additions & 744 deletions

File tree

3rdparty/wxWidgets/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
message(STATUS "Fetching wxWidgets library source...")
77

8-
if(Chevron_WX_SHARED_BUILD)
8+
if(Chevron_SHARED_BUILD)
99
# Build wxWidgets as a shared/dynamic library
1010
set(wxBUILD_SHARED ON)
1111
else()

CMakePresets.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"CMAKE_BUILD_TYPE": "Debug",
1111
"CMAKE_C_COMPILER": "cl.exe",
1212
"CMAKE_CXX_COMPILER": "cl.exe",
13+
"chevron_EXPORTS": "ON",
1314
"CHEVRON_CLI_DEBUG": "ON",
1415
"CHEVRON_UNIT_TEST": "OFF",
1516
"CHEVRON_BENCHMARK": "OFF",
@@ -26,6 +27,7 @@
2627
"CMAKE_BUILD_TYPE": "Debug",
2728
"CMAKE_C_COMPILER": "gcc.exe",
2829
"CMAKE_CXX_COMPILER": "g++.exe",
30+
"chevron_EXPORTS": "ON",
2931
"CHEVRON_CLI_DEBUG": "ON",
3032
"CHEVRON_UNIT_TEST": "OFF",
3133
"CHEVRON_BENCHMARK": "OFF",
@@ -65,6 +67,7 @@
6567
"CMAKE_BUILD_TYPE": "Debug",
6668
"CMAKE_C_COMPILER": "gcc",
6769
"CMAKE_CXX_COMPILER": "g++",
70+
"chevron_EXPORTS": "ON",
6871
"CHEVRON_CLI_DEBUG": "ON",
6972
"CHEVRON_UNIT_TEST": "OFF",
7073
"CHEVRON_BENCHMARK": "OFF",

cmake/compiler/global_c.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,8 @@ target_compile_definitions(
2727
$<$<BOOL:${Chevron_SHARED_BUILD}>:
2828
CHEVRON_SHARED
2929
>
30+
31+
$<$<BOOL:${chevron_EXPORTS}>:
32+
chevron_EXPORTS=1
33+
>
3034
)

cmake/compiler/global_cxx.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,8 @@ target_compile_definitions(
2727
$<$<BOOL:${Chevron_SHARED_BUILD}>:
2828
CHEVRON_SHARED
2929
>
30+
31+
$<$<BOOL:${chevron_EXPORTS}>:
32+
chevron_EXPORTS=1
33+
>
3034
)

cmake/install_config.cmake

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
#======================================
3+
# PROJECT INSTALLATION MODULE
4+
#======================================
5+
6+
# This script should be invoked at the end of
7+
# the /src/CMakeLists.txt file.
8+
9+
# Install main library binary
10+
install(
11+
TARGETS
12+
${CHEVRON_MAIN_BINARY_NAME}
13+
14+
COMPONENT CHEVRON
15+
EXPORT ${CHEVRON_MAIN_BINARY_NAME}-targets
16+
17+
RUNTIME
18+
DESTINATION ${CMAKE_INSTALL_BINDIR}
19+
20+
LIBRARY
21+
DESTINATION ${CMAKE_INSTALL_LIBDIR}
22+
23+
ARCHIVE
24+
DESTINATION ${CMAKE_INSTALL_LIBDIR}
25+
)

cmake/utility/options.cmake

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,3 @@ option(
1717
"Build Chevron with a wxWidgets dependency."
1818
OFF
1919
)
20-
21-
option(
22-
Chevron_WX_SHARED_BUILD
23-
"Build Chevron's wxWidgets dependency as a shared/dynamic library."
24-
ON
25-
)

docs/prj/Chevron_diagrams.drawio

Lines changed: 658 additions & 556 deletions
Large diffs are not rendered by default.

include/chevron/common/export.h

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
2+
// Copyright (C) 2026 by Jamon T. Bailey and InfinSys, LLC. All rights reserved.
3+
// Released under the terms of the GNU Affero General Public License version 3
4+
5+
// [ISJTB-CXX-XL20260108-000003]
6+
7+
/*!
8+
* @file export.h
9+
*
10+
* @brief
11+
* Library symbol visibility macro definitions.
12+
*/
13+
14+
#if defined(_WIN32) || defined(__CYGWIN__)
15+
/*!
16+
* @brief (Building Dynamic Link Library) Chevron public
17+
* API macro for inline functions/variables, templates,
18+
* and header bound entities.
19+
*/
20+
#define CHEVRON_HEADER_API
21+
#ifdef chevron_EXPORTS
22+
/*!
23+
* @brief (Building Dynamic Link Library) Chevron public
24+
* API macro for classes, functions, and extern variables.
25+
*/
26+
#define CHEVRON_API __declspec(dllexport)
27+
#else
28+
/*!
29+
* @brief Chevron public API macro for classes, functions,
30+
* and extern variables.
31+
*/
32+
#define CHEVRON_API __declspec(dllimport)
33+
#endif
34+
#else
35+
#ifdef chevron_EXPORTS
36+
/*!
37+
* @brief (Building Shared Object) Chevron public API macro
38+
* for inline functions/variables, templates, and header
39+
* bound entities.
40+
*/
41+
#define CHEVRON_HEADER_API __attribute__((visibility("default")))
42+
/*!
43+
* @brief (Building Shared Object) Chevron public API macro
44+
* for classes, functions, and extern variables.
45+
*/
46+
#define CHEVRON_API __attribute__((visibility("default")))
47+
#else
48+
#define CHEVRON_API
49+
#define CHEVRON_HEADER_API
50+
#endif
51+
#endif

include/chevron/common/export.hpp

Lines changed: 0 additions & 51 deletions
This file was deleted.

include/chevron/function.hpp

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
2+
// Copyright (C) 2026 by Jamon T. Bailey and InfinSys, LLC. All rights reserved.
3+
// Released under the terms of the GNU Affero General Public License version 3
4+
5+
// [ISJTB-CXX-XL20260108-000003]
6+
7+
/*!
8+
* @file function.hpp
9+
*
10+
* @brief
11+
* General include header for function related facilities.
12+
*/
13+
14+
#ifndef CHEVRON_LIB_HDR_FUNCTION_INCLUDE_H_
15+
#define CHEVRON_LIB_HDR_FUNCTION_INCLUDE_H_
16+
17+
#include "chevron/model/function/func_args.hpp"
18+
#include "chevron/model/function/func_pointer.hpp"
19+
#include <string>
20+
21+
namespace chevron
22+
{
23+
24+
/*! @brief Callable function that accepts no arguments and returns void. */
25+
using VoidReturnNoArgs = FuncPtr<void>;
26+
27+
/*! @brief Callable function that accepts no arguments and returns a boolean. */
28+
using BoolReturnNoArgs = FuncPtr<bool>;
29+
30+
/*! @brief Callable function that accepts no arguments and returns a character. */
31+
using CharReturnNoArgs = FuncPtr<char>;
32+
33+
/*! @brief Callable function that accepts no arguments and returns an integer. */
34+
using IntReturnNoArgs = FuncPtr<int>;
35+
36+
/*! @brief Callable function that accepts no arguments and returns a float. */
37+
using FloatReturnNoArgs = FuncPtr<float>;
38+
39+
/*! @brief Callable function that accepts no arguments and returns a double. */
40+
using DoubleReturnNoArgs = FuncPtr<double>;
41+
42+
/*! @brief Callable function that accepts no arguments and returns a const char pointer. */
43+
using CstrReturnNoArgs = FuncPtr<const char*>;
44+
45+
/*! @brief Callable function that accepts no arguments and returns a string. */
46+
using StringReturnNoArgs = FuncPtr<std::string>;
47+
48+
/*! @brief Callable function that accepts no arguments and returns size_t. */
49+
using SizeReturnNoArgs = FuncPtr<size_t>;
50+
51+
/*! @brief Callable function that accepts no arguments and returns specified type. */
52+
template <typename ReturnT>
53+
using NoArgsReturn = FuncPtr<ReturnT>;
54+
55+
} // namespace chevron
56+
57+
#endif // CHEVRON_LIB_HDR_FUNCTION_INCLUDE_H_

0 commit comments

Comments
 (0)