Skip to content
This repository was archived by the owner on Jan 25, 2024. It is now read-only.

Commit 6b4b7ee

Browse files
committed
Initial Checkin of PFC Framework
Serialization Framework Completed Messages to be added as needed Prototype Service Registry using bost::asio Prototype Service which Registers with the registry then offers either REQ/REP or PUB/SUB style communication
1 parent 7326970 commit 6b4b7ee

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+5504
-3
lines changed

.clang-format

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
---
2+
Language: Cpp
3+
BasedOnStyle: WebKit
4+
AccessModifierOffset: -2
5+
AlignAfterOpenBracket: Align
6+
AlignConsecutiveAssignments: false
7+
AlignConsecutiveDeclarations: false
8+
AlignEscapedNewlines: Right
9+
AlignOperands: false
10+
AlignTrailingComments: false
11+
AllowAllParametersOfDeclarationOnNextLine: true
12+
AllowShortBlocksOnASingleLine: false
13+
AllowShortCaseLabelsOnASingleLine: false
14+
AllowShortFunctionsOnASingleLine: All
15+
AllowShortIfStatementsOnASingleLine: false
16+
AllowShortLoopsOnASingleLine: false
17+
AlwaysBreakAfterDefinitionReturnType: None
18+
AlwaysBreakAfterReturnType: None
19+
AlwaysBreakBeforeMultilineStrings: false
20+
AlwaysBreakTemplateDeclarations: false
21+
BinPackArguments: true
22+
BinPackParameters: true
23+
BraceWrapping:
24+
AfterClass: false
25+
AfterControlStatement: false
26+
AfterEnum: false
27+
AfterFunction: true
28+
AfterNamespace: false
29+
AfterObjCDeclaration: false
30+
AfterStruct: false
31+
AfterUnion: false
32+
BeforeCatch: false
33+
BeforeElse: false
34+
IndentBraces: false
35+
SplitEmptyFunction: true
36+
SplitEmptyRecord: true
37+
SplitEmptyNamespace: true
38+
BreakBeforeBinaryOperators: All
39+
BreakBeforeBraces: WebKit
40+
BreakBeforeInheritanceComma: false
41+
BreakBeforeTernaryOperators: true
42+
BreakConstructorInitializersBeforeComma: false
43+
BreakConstructorInitializers: BeforeComma
44+
BreakAfterJavaFieldAnnotations: false
45+
BreakStringLiterals: true
46+
ColumnLimit: 0
47+
CommentPragmas: '^ IWYU pragma:'
48+
CompactNamespaces: false
49+
ConstructorInitializerAllOnOneLineOrOnePerLine: false
50+
ConstructorInitializerIndentWidth: 2
51+
ContinuationIndentWidth: 2
52+
Cpp11BracedListStyle: false
53+
DerivePointerAlignment: false
54+
DisableFormat: false
55+
ExperimentalAutoDetectBinPacking: false
56+
FixNamespaceComments: false
57+
ForEachMacros:
58+
- foreach
59+
- Q_FOREACH
60+
- BOOST_FOREACH
61+
IncludeCategories:
62+
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
63+
Priority: 2
64+
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
65+
Priority: 3
66+
- Regex: '.*'
67+
Priority: 1
68+
IncludeIsMainRegex: '(Test)?$'
69+
IndentCaseLabels: false
70+
IndentWidth: 2
71+
IndentWrappedFunctionNames: false
72+
JavaScriptQuotes: Leave
73+
JavaScriptWrapImports: true
74+
KeepEmptyLinesAtTheStartOfBlocks: true
75+
MacroBlockBegin: ''
76+
MacroBlockEnd: ''
77+
MaxEmptyLinesToKeep: 1
78+
NamespaceIndentation: Inner
79+
ObjCBlockIndentWidth: 2
80+
ObjCSpaceAfterProperty: true
81+
ObjCSpaceBeforeProtocolList: true
82+
PenaltyBreakAssignment: 2
83+
PenaltyBreakBeforeFirstCallParameter: 19
84+
PenaltyBreakComment: 300
85+
PenaltyBreakFirstLessLess: 120
86+
PenaltyBreakString: 1000
87+
PenaltyExcessCharacter: 1000000
88+
PenaltyReturnTypeOnItsOwnLine: 60
89+
PointerAlignment: Left
90+
ReflowComments: true
91+
SortIncludes: true
92+
SortUsingDeclarations: true
93+
SpaceAfterCStyleCast: false
94+
SpaceAfterTemplateKeyword: true
95+
SpaceBeforeAssignmentOperators: true
96+
SpaceBeforeParens: ControlStatements
97+
SpaceInEmptyParentheses: false
98+
SpacesBeforeTrailingComments: 1
99+
SpacesInAngles: false
100+
SpacesInContainerLiterals: true
101+
SpacesInCStyleCastParentheses: false
102+
SpacesInParentheses: false
103+
SpacesInSquareBrackets: false
104+
Standard: Cpp11
105+
TabWidth: 2
106+
UseTab: Never

CMakeLists.txt

Lines changed: 73 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,73 @@
1-
cmake_minimum_required(VERSION 3.12.0)
2-
project (hello)
3-
add_executable(hello source/cpp/main.cpp)
1+
###############################################################################
2+
# CMAKE DEFINITIONS AND setTINGS
3+
#
4+
# Requires the following environmental variables:
5+
#
6+
# BUILD TYPE ENV VARIABLE Description
7+
# ANDROID ANDROID_NDK Android NDK root folder location
8+
# (also required for toolchain file)
9+
# ANDROID GRADLE_EXECUTABLE Location of the Gradle executable
10+
###############################################################################
11+
set(ROOT_PROJECT_NAME Sustain)
12+
set(${ROOT_PROJECT_NAME}_CMAKE_MIN_VERSION 3.11.0)
13+
set(${ROOT_PROJECT_NAME}_CMAKE_POLICY 3.11.0)
14+
15+
cmake_minimum_required(VERSION ${${ROOT_PROJECT_NAME}_CMAKE_MIN_VERSION})
16+
project(${ROOT_PROJECT_NAME} CXX)
17+
18+
include(cmake/cmake-common_logic.cmake)
19+
include(cmake/UseGit.cmake)
20+
21+
22+
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake ${PROJECT_SOURCE_DIR}/cmake/common )
23+
24+
message(STATUS "
25+
Using the following search paths
26+
CMAKE_MODULE_PATH = ${CMAKE_MODULE_PATH}
27+
CMAKE_PREFIX_PATH = ${CMAKE_PREFIX_PATH}
28+
CMAKE_FIND_ROOT_PATH = ${CMAKE_FIND_ROOT_PATH}
29+
")
30+
31+
add_subdirectory(projects)
32+
33+
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT pfc_registry)
34+
35+
###############################################################################
36+
# Stage Code for IDE Testing
37+
###############################################################################
38+
create_cache_file()
39+
create_stage()
40+
###############################################################################
41+
# Step 3:
42+
# Infrastructure Installation for each library
43+
# your project outputs create a Find${lib}.cmake file
44+
# list them here. This will install them in your sysroot
45+
# so other projects can build off those libraries
46+
###############################################################################
47+
# install(EXPORT lib${ROOT_PROJECT_NAME}
48+
# NAMESPACE ${ROOT_PROJECT_NAME}::
49+
# FILE ${ROOT_PROJECT_NAME}.cmake
50+
# DESTINATION lib/cmake/${ROOT_PROJECT_NAME}
51+
# )
52+
53+
include(CMakePackageConfigHelpers)
54+
# generate the config file that is includes the exports
55+
configure_package_config_file(${PROJECT_SOURCE_DIR}/cmake/${ROOT_PROJECT_NAME}Config.cmake.in
56+
"${CMAKE_CURRENT_BINARY_DIR}/${ROOT_PROJECT_NAME}Config.cmake"
57+
INSTALL_DESTINATION "lib/cmake/${ROOT_PROJECT_NAME}"
58+
NO_SET_AND_CHECK_MACRO
59+
NO_CHECK_REQUIRED_COMPONENTS_MACRO
60+
)
61+
62+
# generate the version file for the config file
63+
write_basic_package_version_file(
64+
"${CMAKE_CURRENT_BINARY_DIR}/${ROOT_PROJECT_NAME}ConfigVersion.cmake"
65+
VERSION "${${ROOT_PROJECT_NAME}_VERSION_MAJOR}.${${ROOT_PROJECT_NAME}_VERSION_MINOR}"
66+
COMPATIBILITY AnyNewerVersion
67+
)
68+
69+
install(FILES
70+
${CMAKE_CURRENT_BINARY_DIR}/${ROOT_PROJECT_NAME}Config.cmake
71+
${Packages}
72+
DESTINATION lib/cmake/${ROOT_PROJECT_NAME}
73+
)

cmake/SustainConfig.cmake.in

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
@PACKAGE_INIT@
2+
3+
include(CMakeFindDependencyMacro)
4+
5+
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})
6+
set(Biogears_XSD_SCHEMA_DIR ${PACKAGE_PREFIX_DIR}/share/biogears/xsd/ CACHE PATH "Directory containing all of the CDM XSD Schema files")
7+
file(GLOB_RECURSE Biogears_XSD_SCHEMA_LIST ${PACKAGE_PREFIX_DIR}/share/biogears/xsd/*.xsd "Exsact list of XSD files for the current Biogears Release")
8+
set(Biogears_XML_DATA_DIR ${PACKAGE_PREFIX_DIR}/share/biogears/data CACHE PATH "Directory containing all of the data files Biogears needs to run")
9+
file(GLOB_RECURSE Biogears_XSD_DATA_LIST ${PACKAGE_PREFIX_DIR}/share/biogears/data/*.xml "Exsact list of XML files for the current Biogears Release")
10+
11+
include ( "${CMAKE_CURRENT_LIST_DIR}/@[email protected]" )
12+
13+
find_dependency(Eigen3)
14+
find_dependency(Log4cpp)
15+
find_dependency(CodeSynthesis)
16+
17+
#
18+
# Function Stage_BioGears_Schema
19+
# Param: DESTINATION - Directory to stage the contents of Biogears_XSD_SCHEMA_DIR
20+
# Param: RESULTS_VAR - Variable to store the results in
21+
#
22+
# Places the value of Biogears_XSD_SCHEMA_LIST in to DIR
23+
# Each file will become its on custom_target and will be staged before by runtime
24+
function(stage_biogears_schema )
25+
cmake_parse_arguments(_
26+
""
27+
"DESTINATION;RESULTS_VAR"
28+
"" ${ARGN})
29+
if(NOT __DESTINATION)
30+
message(FATAL_ERROR "DESTINATION required but not given")
31+
endif()
32+
if(NOT __RESULTS_VAR)
33+
set(__RESULTS_VAR _stage_biogears_schema_results)
34+
endif()
35+
foreach( file IN LISTS Biogears_XSD_SCHEMA_LIST )
36+
string(REPLACE "${Biogears_XSD_SCHEMA_DIR}" "${__DESTINATION}/xsd" destination_file "${file}" )
37+
list(APPEND ${__RESULTS_VAR} ${destination_file} )
38+
add_custom_command(
39+
OUTPUT ${destination_file}
40+
DEPENDS ${file}
41+
COMMAND ${CMAKE_COMMAND} -E copy ${file} ${destination_file}
42+
)
43+
endforeach()
44+
add_custom_target( stage_biogears_schema
45+
DEPENDS
46+
${${__RESULTS_VAR}}
47+
COMMENT "Scanning for need to stage runtime dir"
48+
)
49+
set(${__RESULTS_VAR} ${${__RESULTS_VAR}} PARENT_SCOPE)
50+
endfunction()
51+
52+
#
53+
# Function Stage_BioGears_Data
54+
# Param: DESTINATION - Directory to stage the contents of Biogears_XSD_SCHEMA_DIR
55+
# Param: RESULTS_VAR - Variable to store the results in
56+
#
57+
# Places the value of Biogears_XSD_DATA_LIST in to DIR
58+
# Each file will become its on custom_target and will be staged before by runtime
59+
function(stage_biogears_data)
60+
cmake_parse_arguments(_
61+
""
62+
"DESTINATION;RESULTS_VAR"
63+
"" ${ARGN})
64+
if(NOT __DESTINATION)
65+
message(FATAL_ERROR "DESTINATION required but not given")
66+
endif()
67+
if(NOT __RESULTS_VAR)
68+
set(__RESULTS_VAR _stage_biogears_data_results)
69+
endif()
70+
foreach( file IN LISTS Biogears_XSD_DATA_LIST )
71+
string(REPLACE "${Biogears_XML_DATA_DIR}" "${__DESTINATION}" destination_file "${file}" )
72+
list(APPEND ${__RESULTS_VAR} ${destination_file} )
73+
add_custom_command(
74+
OUTPUT ${destination_file}
75+
DEPENDS ${file}
76+
COMMAND ${CMAKE_COMMAND} -E copy ${file} ${destination_file}
77+
)
78+
endforeach()
79+
add_custom_target(stage_biogears_data
80+
DEPENDS
81+
${${__RESULTS_VAR}}
82+
COMMENT "Scanning for need to stage runtime dir"
83+
)
84+
set(${__RESULTS_VAR} ${${__RESULTS_VAR}} PARENT_SCOPE)
85+
endfunction()

cmake/UseGit.cmake

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#Macros for using GIT -- Requires Git
2+
3+
if(__sustain_git_modlue_support)
4+
return()
5+
endif()
6+
set(__sustain_git_modlue_support YES)
7+
8+
9+
function(git_describe VERSION_MAJOR VERSION_MINOR VERSION_PATCH VERSION_SHA1 VERSION_SHORT)
10+
if( NOT GIT_FOUND )
11+
find_package(GIT REQUIRED)
12+
endif()
13+
14+
execute_process(COMMAND
15+
"${GIT_EXECUTABLE} describe --tags --dirty --long"
16+
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
17+
RESULT_VARIABLE __git_error
18+
OUTPUT_VARIABLE __git_output
19+
ERROR_QUIET
20+
OUTPUT_STRIP_TRAILING_WHITESPACE)
21+
22+
23+
if(NOT __git_error )
24+
message(STATUS "${__git_error}")
25+
endif()
26+
27+
string(REGEX REPLACE "^v([0-9]+)\\..*" "\\1" __major "${__git_output}")
28+
string(REGEX REPLACE "^v[0-9]+\\.([0-9]+).*" "\\1" __minor "${__git_output}")
29+
string(REGEX REPLACE "^v[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" __patch "${__git_output}")
30+
string(REGEX REPLACE "^v[0-9]+\\.[0-9]+\\.[0-9]+g(.*)" "\\1" __sha1 "${__git_output}")
31+
string(REGEX REPLACE "^v[0-9]+\\.[0-9]+\\.[0-9]+g.*-(dirty)" "\\1" __dirty "${__git_output}")
32+
set(__version_short "${__major}.${__minor}.${_patch}")
33+
34+
set(GIT_MAJOR_VERSION ${__major} PARENT_SCOPE)
35+
set(GIT_MINOR_VERSION ${__minor} PARENT_SCOPE)
36+
set(GIT_PATCH_VERSION ${__patch} PARENT_SCOPE)
37+
set(GIT_SHA1_VERSION ${__sha1} PARENT_SCOPE)
38+
set(GIT_REV_RESULT ${__git_output} PARENT_SCOPE)
39+
40+
endfunction()
41+

0 commit comments

Comments
 (0)