Skip to content

Commit 6ee9793

Browse files
Merge pull request #50 from connectivecpp/develop
Merging develop into master for Windows builds
2 parents ff10275 + d62a933 commit 6ee9793

20 files changed

+277
-225
lines changed

CMakeLists.txt

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2019 by Cliff Green
1+
# Copyright 2019-2020 by Cliff Green
22
#
33
# https://github.com/connectivecpp/chops-net-ip
44
#
@@ -11,18 +11,29 @@ cmake_minimum_required ( VERSION 3.8 )
1111

1212
option ( CHOPS_NET_IP_OPT_BUILD_TESTS "Build and perform chops-net-ip tests" ON )
1313
option ( CHOPS_NET_IP_OPT_BUILD_EXAMPLES "Build and perform chops-net-ip examples" ON )
14+
option ( CHOPS_NET_IP_OPT_BUILD_DOCS "Build doxygen documentation" OFF )
15+
16+
set ( OPTIONS "" )
17+
set ( DEFINITIONS "" )
1418

1519
project ( chops-net-ip VERSION 1.0 LANGUAGES CXX )
1620

1721
set ( package_name "chops-net-ip" )
1822

1923
set ( include_source_dir "${CMAKE_SOURCE_DIR}/include" )
24+
set ( utility_rack_dir "${CMAKE_SOURCE_DIR}/../utility-rack" )
25+
set ( utility_rack_include_source_dir "${utility_rack_dir}/include" )
26+
set ( third_party_include_source_dir "${utility_rack_dir}/third_party" )
27+
set ( cmake_include_dir "${CMAKE_SOURCE_DIR}/cmake" )
28+
set ( cmake_all_repos_include_dir "${utility_rack_dir}/cmake/all_repos" )
29+
2030

2131
# Interface library:
2232

2333
add_library ( ${package_name} INTERFACE )
2434

2535
target_include_directories ( ${package_name} INTERFACE ${include_source_dir} )
36+
target_include_directories ( ${package_name} INTERFACE ${third_party_include_source_dir} )
2637
target_compile_features ( ${package_name} INTERFACE cxx_std_17)
2738

2839
if ( CHOPS_NET_IP_OPT_BUILD_TESTS )
@@ -31,9 +42,12 @@ if ( CHOPS_NET_IP_OPT_BUILD_TESTS )
3142
endif()
3243

3344
if ( CHOPS_NET_IP_OPT_BUILD_EXAMPLES )
34-
enable_testing()
3545
add_subdirectory ( example )
3646
endif()
3747

48+
if ( CHOPS_NET_IP_OPT_BUILD_DOCS )
49+
add_subdirectory ( doc )
50+
endif()
51+
3852
# end of file
3953

README.md

Lines changed: 15 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
Branch | Status
2-
|---|---|
3-
**Master** | [![Build Status](https://travis-ci.org/connectivecpp/chops-net-ip.svg?branch=master)](https://travis-ci.org/connectivecpp/chops-net-ip)
4-
**Develop** | [![Build Status](https://travis-ci.org/connectivecpp/chops-net-ip.svg?branch=develop)](https://travis-ci.org/connectivecpp/chops-net-ip)
5-
6-
71
# Chops Net IP - Connective Handcrafted Openwork Software for Asynchronous IP Networking
82

93
Chops Net IP is a C++ library that makes asynchronous networking programming fun. Or at least if not fun, it makes network programming easier and safer, without significantly sacrificing performance. Chops Net IP handles Internet Protocol (IP) communications including TCP, UDP, and UDP multicast. It is written using modern C++ design idioms and the latest (2017) C++ standard.
@@ -12,23 +6,26 @@ Chops Net IP is not like any other high-level, general purpose C++ socket librar
126

137
Chops Net IP is layered on top of the Asio asynchronous networking library, taking advantage of the portability and functionality that Asio provides. However, it simplifies network programming compared to coding against the Asio API, while providing easy scalability through the asynchronous facilities.
148

15-
# License
16-
17-
[![Licence](https://img.shields.io/badge/license-boost-4480cc.svg)](http://www.boost.org/LICENSE_1_0.txt)
9+
# Build and Release Status, License Info
1810

19-
This project is distributed under the [Boost Software License](LICENSE.txt).
11+
Branch | Status
12+
|---|---|
13+
**Master** | [![Build Status](https://travis-ci.org/connectivecpp/chops-net-ip.svg?branch=master)](https://travis-ci.org/connectivecpp/chops-net-ip)
14+
**Develop** | [![Build Status](https://travis-ci.org/connectivecpp/chops-net-ip.svg?branch=develop)](https://travis-ci.org/connectivecpp/chops-net-ip)
2015

21-
## Chops Net IP Release Status
16+
**Latest tag:** ![Latest Tag](https://img.shields.io/github/v/tag/connectivecpp/chops-net-ip)
2217

2318
Release 1.0 is under development as of January 2020, awaiting CMake enhancements, a comprehensive tutorial, and additional testing under multiple compilers and platforms.
2419

2520
Release notes and upcoming development plans are [available here](doc/release.md).
2621

22+
This project is distributed under the [Boost Software License](LICENSE.txt): [![Licence](https://img.shields.io/badge/license-boost-4480cc.svg)](http://www.boost.org/LICENSE_1_0.txt)
23+
2724
# Overview
2825

2926
For many software developers, asynchronous network programming in C++ is not easy. It is complex, has many pitfalls, and requires designing C++ code in a way that is not natural, even for those with years of experience. Chops Net IP ("C"onnective "H"andcrafted "Op"enwork "S"oftware, Networking over Internet Protocol) simplifies asynchronous network programming and provides useful (and tasty!) abstractions for many types of communication patterns.
3027

31-
Chops Net IP is layered on top of Chris Kohlhoff's Asio library (see [References](doc/references.md)) allowing it to be portable across many compilers and platforms. When the C++ Networking TS is standardized (possibly C++ 23 but more likely C++ 26) Chops Net IP will directly use the networking facilities of the C++ standard library.
28+
Chops Net IP is layered on top of Chris Kohlhoff's Asio library (see [References](https://connectivecpp.github.io/doc/references.html)) allowing it to be portable across many compilers and platforms. When the C++ Networking TS is standardized (possibly C++ 23 but more likely C++ 26) Chops Net IP will directly use the networking facilities of the C++ standard library.
3229

3330
Chops Net IP simplifies application code that processes data on multiple simultaneous TCP connections or UDP endpoints. All Chops Net IP operations (from the application viewpoint) are no-wait (i.e. there are no blocking methods) and all network processing operations are performed asynchronously.
3431

@@ -79,18 +76,10 @@ A detailed overview, a C++ socket library comparison, and a FAQ is [available he
7976

8077
# C++ Language Requirements and Alternatives
8178

82-
C++ 17 is the primary standards baseline for this repository. There is also one future C++ facility in use (`std::expected`, allowing error handling without using exceptions).
83-
84-
A significant number of C++ 11 features are in the implementation and API. There are also C++ 14 and 17 features in use such as `std::byte`, `std::optional`, `std::variant` and `auto` parameters in lambda functions. For users that don't want to use the latest C++ compilers or compile with C++ 17 flags, Martin Moene provides an excellent set of header-only libraries that implement many useful C++ 17 library features (for older compilers or standards), as well as future C++ features (see [References](doc/references.md)).
85-
86-
While the main production branch will always be developed and tested with C++ 17 features (and relatively current compilers), alternative branches and forks for older compiler versions are welcome. In particular, a branch using Martin's libraries and general C++ 11 (or C++ 14) conformance would be useful. A branch supporting a pre-C++ 11 compiler or language conformance is not likely to be directly supported through this repository (since it would require so many changes that it would result in a defacto different codebase).
79+
C++ 17 is the primary baseline for this repository. Additional notes on possible alternatives are [available here](https://connectivecpp.github.io/).
8780

8881
# External Dependencies
8982

90-
The libraries and API's have minimal (as possible) library dependencies (there are heavy dependencies on the C++ standard library in all of the code). There are more dependencies in the test code than in the production code.
91-
92-
All the dependencies listed below have links that will take you to the library or repository.
93-
9483
Production external dependencies:
9584

9685
- Version 1.13 (or later) of Chris Kohlhoff's [`asio`](https://github.com/chriskohlhoff/asio) library is required. Note that it is the stand-alone Asio library, not the Boost Asio version.
@@ -104,7 +93,7 @@ There are single file headers that have been copied into the `third_party` direc
10493

10594
- Martin Moene's [`expected-lite`](https://github.com/martinmoene/expected-lite) library.
10695

107-
See [References](doc/references.md) for additional details.
96+
See [References](https://connectivecpp.github.io/doc/references.html) for additional details.
10897

10998
# Supported Compilers and Platforms
11099

@@ -121,9 +110,11 @@ Chops Net IP is header-only, so installation consists of downloading or cloning
121110

122111
# References
123112

124-
See [References](doc/references.md) for details on dependencies and inspirations for Chops Net IP.
113+
See [References](https://connectivecpp.github.io/doc/references.html) for details on dependencies and inspirations for Chops Net IP.
125114

126115
# About
127116

128-
Team member information is [available here](https://connectivecpp.github.io/), and a few random author comments are [available here](doc/about.md).
117+
Team member information is [available here](https://connectivecpp.github.io/).
118+
119+
A few "Cliff Notes" are [available here](doc/cliff_notes.md).
129120

cmake/add_target_dependencies.cmake

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Copyright 2020 by Cliff Green
2+
#
3+
# https://github.com/connectivecpp/utility-rack
4+
#
5+
# Distributed under the Boost Software License, Version 1.0.
6+
# (See accompanying file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7+
8+
# Still learning find_package and related ways to bring in third party dependent include directories,
9+
# so don't judge, instead please help.
10+
11+
set ( catch2_include_dir "${CMAKE_SOURCE_DIR}/../Catch2/single_include" )
12+
if ( NOT $ENV{CATCH2_INCLUDE_DIR} STREQUAL "" )
13+
set ( catch2_include_dir $ENV{CATCH2_INCLUDE_DIR}} )
14+
endif()
15+
set ( asio_include_dir "${CMAKE_SOURCE_DIR}/../asio/asio/include" )
16+
if ( NOT $ENV{ASIO_INCLUDE_DIR} STREQUAL "" )
17+
set ( asio_include_dir $ENV{ASIO_INCLUDE_DIR}} )
18+
endif()
19+
20+
function ( add_target_dependencies target )
21+
# find_package ( Catch2 REQUIRED )
22+
# target_include_directories ( ${target} PRIVATE ${Catch2_INCLUDE_DIRS} )
23+
target_include_directories ( ${target} PRIVATE ${catch2_include_dir} )
24+
# find_package ( asio REQUIRED )
25+
# target_include_directories ( ${target} PRIVATE ${asio_INCLUDE_DIRS} )
26+
target_include_directories ( ${target} PRIVATE ${asio_include_dir} )
27+
endfunction()
28+
29+
# end of file
30+

cmake/header_dirs_var.cmake

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Copyright 2020 by Cliff Green
2+
#
3+
# https://github.com/connectivecpp/utility-rack
4+
#
5+
# Distributed under the Boost Software License, Version 1.0.
6+
# (See accompanying file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7+
8+
set ( header_dirs
9+
"${include_source_dir}"
10+
"${utility_rack_include_source_dir}"
11+
"${third_party_include_source_dir}"
12+
)
13+
14+
# end of file
15+

doc/CMakeLists.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Copyright 2020 by Cliff Green
2+
#
3+
# https://github.com/connectivecpp/chops-net-ip
4+
#
5+
# Distributed under the Boost Software License, Version 1.0.
6+
# (See accompanying file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7+
8+
cmake_minimum_required ( VERSION 3.9 )
9+
10+
project ( chops-net-ip-doc VERSION 1.0 LANGUAGES CXX )
11+
12+
set ( doxygen_proj_name "Chops Net IP Reference" )
13+
include ( "${cmake_all_repos_include_dir}/doxygen_gen.cmake" )
14+
15+
# end of file
16+

doc/about.md renamed to doc/cliff_notes.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# Author Notes and Contributor Information
2-
31
## A Cliff Note on the Chops Name
42

53
>(from Cliff, 2018) Yes, the name / acronym is a stretch. Quite a stretch. I like the word "chops", which is a jazz term for strong technique, so I decided on that for a name. For example, "Check out Tal Wilkenfeld, she's got mad chops."
@@ -16,6 +14,6 @@
1614
1715
>Even though I didn't use "openhearted" in the name, it's an aspect that I aspire to in every part of my life. I fall short, very often, but not because of lack of effort or desire.
1816
19-
>I mentioned Tal earlier in this note, so here are two representative YouTube videos of her playing with Jeff Beck, who I consider one of the all time best guitarists. The first video is a blend of jazz, rock, and funk, the second is the two of them playing one of my favorite rock / jazz fusion ballads: https://www.youtube.com/watch?v=jVb-izZVCwQ, https://www.youtube.com/watch?v=blp7hPFaIfU
17+
>I mentioned Tal earlier in this note, so here is a representative YouTube video of her playing with Jeff Beck, who I consider one of the all time best guitarists. It is a blend of jazz, rock, and funk - https://www.youtube.com/watch?v=jVb-izZVCwQ.
2018
21-
>And since I'm on a music digression, an artist I often listen to while writing code is Helios. His music is instrumental, space music'ey, ambient, contains a nice amount of harmonic and rhythmic complexity, and is very melodic. Most important it doesn't interfere with my concentration. A good album to start with is Eingya: https://www.youtube.com/watch?v=fud-Lz76MHg
19+
>And since I'm on a music digression, an artist I often listen to while writing code is Helios. His music is instrumental, space music'ey, ambient, contains a nice amount of harmonic and rhythmic complexity, and is very melodic. Most important it doesn't interfere with my concentration. A good album to start with is Eingya.

doc/html/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Chops Net IP Doxygen Pages
2+
3+
This directory contains HTML pages generated by Doxygen. The content is extracted from the source code.

doc/references.md

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

doc/release.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,13 @@
22

33
## Release 1.0
44

5-
Release 1.0 is under development, expected in the first part of 2020. Additional platform and compiler testing is under way, in-depth tutorials are under development, and the marshalling library in the `utility-rack` repository needs to be completed.
5+
Release 1.0 is under development, expected in the first part of 2020. The functionality is already well tested under g++ and clang++ on Linux, MacOS, and Raspbian, but needs additional testing on other compilers and platforms including VC++ on Windows.
6+
7+
### Next Steps, ToDo's, Problems, and Constraints:
8+
9+
- The CMake files (CMakeLists.txts, etc) are working but enhancements and improvements are needed. CMake is relatively new for the Connective C++ team and enhancement requests are welcome.
10+
- Code coverage tools have not been used on the codebase.
11+
- The Doxygen annotation is mostly complete, but additional tutorial content is needed.
612

713
## Release 0.3
814

example/CMakeLists.txt

Lines changed: 8 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2019 by Cliff Green
1+
# Copyright 2019-2020 by Cliff Green
22
#
33
# https://github.com/connectivecpp/chops-net-ip
44
#
@@ -11,6 +11,8 @@ project ( chops-net-ip-example VERSION 1.0 LANGUAGES CXX )
1111

1212
set ( example_source_dir "${CMAKE_SOURCE_DIR}/example" )
1313

14+
include ( "${cmake_include_dir}/header_dirs_var.cmake" )
15+
1416
set ( example_sources
1517
"${example_source_dir}/local_echo_demo.cpp"
1618
"${example_source_dir}/chat_server_demo.cpp"
@@ -20,57 +22,15 @@ set ( example_sources
2022
"${example_source_dir}/udp_broadcast_demo.cpp"
2123
"${example_source_dir}/udp_receiver_demo.cpp" )
2224

23-
set ( OPTIONS "" )
24-
set ( DEFINITIONS "" )
25-
26-
set ( header_dirs
27-
"${include_source_dir}"
28-
# "${test_include_dir}"
29-
)
30-
31-
# Still learning find_package and related ways to bring in third party dependent include directories,
32-
# so don't judge, instead please help.
33-
34-
set ( utility_rack_include_dir
35-
"${CMAKE_SOURCE_DIR}/../utility-rack/include"
36-
"${CMAKE_SOURCE_DIR}/../utility-rack/third_party"
37-
)
38-
if ( NOT $ENV{UTILITY_RACK_INCLUDE_DIR} STREQUAL "" )
39-
set ( utility_rack_include_dir $ENV{UTILITY_RACK_INCLUDE_DIR}} )
40-
endif()
41-
set ( asio_include_dir "${CMAKE_SOURCE_DIR}/../asio/asio/include" )
42-
if ( NOT $ENV{ASIO_INCLUDE_DIR} STREQUAL "" )
43-
set ( asio_include_dir $ENV{ASIO_INCLUDE_DIR}} )
44-
endif()
45-
46-
function ( add_target_dependencies target )
47-
# find_package ( utility-rack REQUIRED )
48-
# target_include_directories ( ${target} PRIVATE ${utility-rack_INCLUDE_DIRS} )
49-
target_include_directories ( ${target} PRIVATE ${utility_rack_include_dir} )
50-
# find_package ( asio REQUIRED )
51-
# target_include_directories ( ${target} PRIVATE ${asio_INCLUDE_DIRS} )
52-
target_include_directories ( ${target} PRIVATE ${asio_include_dir} )
53-
endfunction()
54-
55-
function ( add_target_info target )
56-
target_compile_features ( ${target} PRIVATE cxx_std_17 )
57-
target_compile_options ( ${target} PRIVATE ${OPTIONS} )
58-
target_compile_definitions ( ${target} PRIVATE ${DEFINITIONS} )
59-
target_include_directories ( ${target} PRIVATE ${header_dirs} )
60-
add_target_dependencies ( ${target} )
61-
endfunction()
25+
include ( "${cmake_include_dir}/add_target_dependencies.cmake" )
6226

63-
function ( make_exe target src )
64-
add_executable ( ${target} ${src} )
65-
add_target_info ( ${target} )
66-
target_link_libraries ( ${target} PRIVATE pthread )
67-
message ( "Example executable to create: ${target}" )
68-
endfunction()
27+
include ( "${cmake_all_repos_include_dir}/add_target_info_func.cmake" )
28+
include ( "${cmake_all_repos_include_dir}/target_exe_func.cmake" )
6929

7030
foreach ( example_src IN LISTS example_sources )
7131
get_filename_component ( targ ${example_src} NAME_WE )
72-
message ( "Calling make_exe for: ${targ}" )
73-
make_exe ( ${targ} ${example_src} )
32+
message ( "Calling target_exe for: ${targ}" )
33+
target_exe ( ${targ} ${example_src} )
7434
endforeach()
7535

7636
# end of file

0 commit comments

Comments
 (0)