diff --git a/Package.swift b/Package.swift index b565cbf1..7ea8ae7c 100644 --- a/Package.swift +++ b/Package.swift @@ -136,7 +136,7 @@ if libraryEvolutionCondition { let openGraphTarget = Target.target( name: "OpenGraph", - dependencies: ["OpenGraph_SPI"], + dependencies: ["OpenGraphCxx"], cSettings: sharedCSettings, swiftSettings: sharedSwiftSettings ) @@ -144,7 +144,7 @@ let openGraphTarget = Target.target( // OpenGraph is a C++ & Swift mix target. // The SwiftPM support for such usage is still in progress. let openGraphSPITarget = Target.target( - name: "OpenGraph_SPI", + name: "OpenGraphCxx", cSettings: sharedCSettings + [ .define("__COREFOUNDATION_FORSWIFTFOUNDATIONONLY__", to: "1", .when(platforms: .nonDarwinPlatforms)), ], @@ -170,14 +170,11 @@ let openGraphTestTarget = Target.testTarget( swiftSettings: sharedSwiftSettings ) let openGraphSPITestTarget = Target.testTarget( - name: "OpenGraph_SPITests", + name: "OpenGraphCxxTests", dependencies: [ - "OpenGraph_SPI", + "OpenGraphCxx", ], exclude: ["README.md"], - cSettings: sharedCSettings + [ - .headerSearchPath("../../Sources/OpenGraph_SPI"), - ], swiftSettings: sharedSwiftSettings + [.interoperabilityMode(.Cxx)] ) let openGraphShimsTestTarget = Target.testTarget( @@ -204,8 +201,8 @@ let openGraphCompatibilityTestTarget = Target.testTarget( let package = Package( name: "OpenGraph", products: [ - .library(name: "OpenGraph", type: .dynamic, targets: ["OpenGraph", "OpenGraph_SPI"]), - .library(name: "OpenGraphShims", type: .dynamic, targets: ["OpenGraph", "OpenGraph_SPI", "OpenGraphShims"]), + .library(name: "OpenGraph", type: .dynamic, targets: ["OpenGraph", "OpenGraphCxx"]), + .library(name: "OpenGraphShims", type: .dynamic, targets: ["OpenGraph", "OpenGraphCxx", "OpenGraphShims"]), ], dependencies: [ .package(url: "https://github.com/apple/swift-numerics", from: "1.0.2"), diff --git a/README.md b/README.md index 1db2f5ae..281a58e9 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ The current suggested toolchain to build the project is Swift 6.1 / Xcode 16.3. ## Credits -OpenGraph_SPI's Data, Graph, Vector and more is modified based on [Compute](https://github.com/jcmosc/Compute)'s implementations. +OpenGraphCxx's Data, Graph, Vector and more is modified based on [Compute](https://github.com/jcmosc/Compute)'s implementations. ## License diff --git a/Scripts/gen_ag_interface_template.sh b/Scripts/gen_ag_interface_template.sh index ff59fa4f..68a816e7 100755 --- a/Scripts/gen_ag_interface_template.sh +++ b/Scripts/gen_ag_interface_template.sh @@ -14,8 +14,8 @@ swift build -c release -Xswiftc -emit-module-interface -Xswiftc -enable-library- cp .build/release/Modules/OpenGraph.swiftinterface ./template.swiftinterface sed -i '' '1,4d' ./template.swiftinterface -sed -i '' 's/@_exported public import OpenGraph_SPI/@_exported public import AttributeGraph/g' ./template.swiftinterface -sed -i '' 's/OpenGraph_SPI\.//g' ./template.swiftinterface +sed -i '' 's/@_exported public import OpenGraphCxx/@_exported public import AttributeGraph/g' ./template.swiftinterface +sed -i '' 's/OpenGraphCxx\.//g' ./template.swiftinterface sed -i '' 's/OpenGraph/AttributeGraph/g' ./template.swiftinterface sed -i '' 's/OG/AG/g' ./template.swiftinterface diff --git a/Sources/OpenGraph/Attribute/Attribute/AnyAttribute.swift b/Sources/OpenGraph/Attribute/Attribute/AnyAttribute.swift index a9eaef40..4fd87334 100644 --- a/Sources/OpenGraph/Attribute/Attribute/AnyAttribute.swift +++ b/Sources/OpenGraph/Attribute/Attribute/AnyAttribute.swift @@ -5,7 +5,7 @@ // Audited for RELEASE_2021 // Status: API complete -public import OpenGraph_SPI +public import OpenGraphCxx extension AnyAttribute { public typealias Flags = OGAttributeTypeFlags diff --git a/Sources/OpenGraph/Attribute/Attribute/Attribute.swift b/Sources/OpenGraph/Attribute/Attribute/Attribute.swift index cfcab2de..e92d2a92 100644 --- a/Sources/OpenGraph/Attribute/Attribute/Attribute.swift +++ b/Sources/OpenGraph/Attribute/Attribute/Attribute.swift @@ -1,4 +1,4 @@ -public import OpenGraph_SPI +public import OpenGraphCxx @frozen @propertyWrapper diff --git a/Sources/OpenGraph/Attribute/Body/AttributeBody.swift b/Sources/OpenGraph/Attribute/Body/AttributeBody.swift index e7919edd..373471cd 100644 --- a/Sources/OpenGraph/Attribute/Body/AttributeBody.swift +++ b/Sources/OpenGraph/Attribute/Body/AttributeBody.swift @@ -5,7 +5,7 @@ // Audited for RELEASE_2021 // Status: Complete -public import OpenGraph_SPI +public import OpenGraphCxx public protocol _AttributeBody { static func _destroySelf(_ pointer: UnsafeMutableRawPointer) diff --git a/Sources/OpenGraph/Attribute/Rule/Rule.swift b/Sources/OpenGraph/Attribute/Rule/Rule.swift index afb92e66..6f9df86f 100644 --- a/Sources/OpenGraph/Attribute/Rule/Rule.swift +++ b/Sources/OpenGraph/Attribute/Rule/Rule.swift @@ -5,7 +5,7 @@ // Audited for RELEASE_2021 // Status: Complete -public import OpenGraph_SPI +public import OpenGraphCxx public protocol Rule: _AttributeBody { associatedtype Value diff --git a/Sources/OpenGraph/Attribute/Rule/StatefulRule.swift b/Sources/OpenGraph/Attribute/Rule/StatefulRule.swift index 75d5c367..0812eba2 100644 --- a/Sources/OpenGraph/Attribute/Rule/StatefulRule.swift +++ b/Sources/OpenGraph/Attribute/Rule/StatefulRule.swift @@ -5,7 +5,7 @@ // Audited for RELEASE_2021 // Status: Complete -public import OpenGraph_SPI +public import OpenGraphCxx public protocol StatefulRule: _AttributeBody { associatedtype Value diff --git a/Sources/OpenGraph/Attribute/RuleContext/AnyRuleContext.swift b/Sources/OpenGraph/Attribute/RuleContext/AnyRuleContext.swift index 89139182..c676a250 100644 --- a/Sources/OpenGraph/Attribute/RuleContext/AnyRuleContext.swift +++ b/Sources/OpenGraph/Attribute/RuleContext/AnyRuleContext.swift @@ -5,7 +5,7 @@ // Audited for RELEASE_2021 // Status: Complete -public import OpenGraph_SPI +public import OpenGraphCxx @frozen public struct AnyRuleContext: Equatable { diff --git a/Sources/OpenGraph/Attribute/RuleContext/RuleContext.swift b/Sources/OpenGraph/Attribute/RuleContext/RuleContext.swift index b86c2006..702a9a0e 100644 --- a/Sources/OpenGraph/Attribute/RuleContext/RuleContext.swift +++ b/Sources/OpenGraph/Attribute/RuleContext/RuleContext.swift @@ -5,7 +5,7 @@ // Audited for RELEASE_2021 // Status: Complete -public import OpenGraph_SPI +public import OpenGraphCxx @frozen public struct RuleContext: Equatable { diff --git a/Sources/OpenGraph/Attribute/Weak/AnyWeakAttribute.swift b/Sources/OpenGraph/Attribute/Weak/AnyWeakAttribute.swift index a2849009..93bfb484 100644 --- a/Sources/OpenGraph/Attribute/Weak/AnyWeakAttribute.swift +++ b/Sources/OpenGraph/Attribute/Weak/AnyWeakAttribute.swift @@ -5,7 +5,7 @@ // Audited for RELEASE_2021 // Status: Complete -public import OpenGraph_SPI +public import OpenGraphCxx public typealias AnyWeakAttribute = OGWeakAttribute diff --git a/Sources/OpenGraph/Attribute/Weak/WeakAttribute.swift b/Sources/OpenGraph/Attribute/Weak/WeakAttribute.swift index eaa99f97..e0334b38 100644 --- a/Sources/OpenGraph/Attribute/Weak/WeakAttribute.swift +++ b/Sources/OpenGraph/Attribute/Weak/WeakAttribute.swift @@ -5,7 +5,7 @@ // Audited for RELEASE_2021 // Status: Complete -public import OpenGraph_SPI +public import OpenGraphCxx @frozen @propertyWrapper diff --git a/Sources/OpenGraph/Export.swift b/Sources/OpenGraph/Export.swift index 3c7bc4bf..bd56c5fb 100644 --- a/Sources/OpenGraph/Export.swift +++ b/Sources/OpenGraph/Export.swift @@ -1,4 +1,4 @@ -@_exported public import OpenGraph_SPI +@_exported public import OpenGraphCxx // Align the constant define behavior #if OPENGRAPH_RELEASE_2024 diff --git a/Sources/OpenGraph/Graph/Graph.swift b/Sources/OpenGraph/Graph/Graph.swift index 6c42100d..baec580c 100644 --- a/Sources/OpenGraph/Graph/Graph.swift +++ b/Sources/OpenGraph/Graph/Graph.swift @@ -5,7 +5,7 @@ // Audited for RELEASE_2021 // Status: WIP -public import OpenGraph_SPI +public import OpenGraphCxx extension Graph { public static func typeIndex( diff --git a/Sources/OpenGraph/Graph/Subgraph.swift b/Sources/OpenGraph/Graph/Subgraph.swift index f2a2c295..22e5639c 100644 --- a/Sources/OpenGraph/Graph/Subgraph.swift +++ b/Sources/OpenGraph/Graph/Subgraph.swift @@ -5,7 +5,7 @@ // Audited for RELEASE_2021 // Status: WIP -public import OpenGraph_SPI +public import OpenGraphCxx extension Subgraph { public func addObserver(_ observer: () -> Void) -> Int { diff --git a/Sources/OpenGraph/Runtime/CompareValues.swift b/Sources/OpenGraph/Runtime/CompareValues.swift index 74d9a330..a5accf54 100644 --- a/Sources/OpenGraph/Runtime/CompareValues.swift +++ b/Sources/OpenGraph/Runtime/CompareValues.swift @@ -5,7 +5,7 @@ // Audited for RELEASE_2021 // Status: Complete -public import OpenGraph_SPI +public import OpenGraphCxx @_silgen_name("OGCompareValues") private func OGCompareValues( diff --git a/Sources/OpenGraph/Runtime/Metadata.swift b/Sources/OpenGraph/Runtime/Metadata.swift index e602b40f..9596830a 100644 --- a/Sources/OpenGraph/Runtime/Metadata.swift +++ b/Sources/OpenGraph/Runtime/Metadata.swift @@ -5,7 +5,7 @@ // Audited for RELEASE_2021 // Status: WIP -public import OpenGraph_SPI +public import OpenGraphCxx #if canImport(ObjectiveC) public import Foundation #endif diff --git a/Sources/OpenGraph/Runtime/OGTypeApplyEnumData.swift b/Sources/OpenGraph/Runtime/OGTypeApplyEnumData.swift index bb232190..86392277 100644 --- a/Sources/OpenGraph/Runtime/OGTypeApplyEnumData.swift +++ b/Sources/OpenGraph/Runtime/OGTypeApplyEnumData.swift @@ -4,7 +4,7 @@ // // -// public import OpenGraph_SPI +// public import OpenGraphCxx @discardableResult public func withUnsafePointerToEnumCase( diff --git a/Sources/OpenGraph/Runtime/TupleType.swift b/Sources/OpenGraph/Runtime/TupleType.swift index 46b4685d..ab2e1139 100644 --- a/Sources/OpenGraph/Runtime/TupleType.swift +++ b/Sources/OpenGraph/Runtime/TupleType.swift @@ -5,7 +5,7 @@ // Audited for iOS 18.0 // Status: WIP -public import OpenGraph_SPI +public import OpenGraphCxx // MARK: TupleType diff --git a/Sources/OpenGraphCxx/Attribute/AttributeID.cpp b/Sources/OpenGraphCxx/Attribute/AttributeID.cpp new file mode 100644 index 00000000..261db98b --- /dev/null +++ b/Sources/OpenGraphCxx/Attribute/AttributeID.cpp @@ -0,0 +1,5 @@ +// +// AttributeID.cpp +// OpenGraphCxx + +#include diff --git a/Sources/OpenGraph_SPI/Attribute/AttributeType.cpp b/Sources/OpenGraphCxx/Attribute/AttributeType.cpp similarity index 64% rename from Sources/OpenGraph_SPI/Attribute/AttributeType.cpp rename to Sources/OpenGraphCxx/Attribute/AttributeType.cpp index 91c8ede1..c66428ce 100644 --- a/Sources/OpenGraph_SPI/Attribute/AttributeType.cpp +++ b/Sources/OpenGraphCxx/Attribute/AttributeType.cpp @@ -5,4 +5,4 @@ // Created by Kyle on 2024/2/17. // -#include "OGAttributeType.h" +#include diff --git a/Sources/OpenGraph_SPI/Attribute/OGAttribute.cpp b/Sources/OpenGraphCxx/Attribute/OGAttribute.cpp similarity index 97% rename from Sources/OpenGraph_SPI/Attribute/OGAttribute.cpp rename to Sources/OpenGraphCxx/Attribute/OGAttribute.cpp index 2008742d..4f307832 100644 --- a/Sources/OpenGraph_SPI/Attribute/OGAttribute.cpp +++ b/Sources/OpenGraphCxx/Attribute/OGAttribute.cpp @@ -5,10 +5,9 @@ // Created by Kyle on 2024/2/16. // -#include "OGAttribute.h" -#include "AttributeID.hpp" -#include "../Attribute/AttributeID.hpp" -#include "../Util/assert.hpp" +#include +#include +#include #include const OGAttribute OGAttributeNil = OGAttribute(OG::AttributeID::Kind::Null); diff --git a/Sources/OpenGraph_SPI/Attribute/OGWeakAttribute.cpp b/Sources/OpenGraphCxx/Attribute/OGWeakAttribute.cpp similarity index 91% rename from Sources/OpenGraph_SPI/Attribute/OGWeakAttribute.cpp rename to Sources/OpenGraphCxx/Attribute/OGWeakAttribute.cpp index 686c5474..faad5166 100644 --- a/Sources/OpenGraph_SPI/Attribute/OGWeakAttribute.cpp +++ b/Sources/OpenGraphCxx/Attribute/OGWeakAttribute.cpp @@ -5,7 +5,7 @@ // Created by Kyle on 2024/2/27. // -#include "OGWeakAttribute.h" +#include OGWeakAttribute OGCreateWeakAttribute(OGAttribute attribute) { // TODO diff --git a/Sources/OpenGraph_SPI/Comparison/OGComparison.cpp b/Sources/OpenGraphCxx/Comparison/OGComparison.cpp similarity index 90% rename from Sources/OpenGraph_SPI/Comparison/OGComparison.cpp rename to Sources/OpenGraphCxx/Comparison/OGComparison.cpp index fa497d51..a284e759 100644 --- a/Sources/OpenGraph_SPI/Comparison/OGComparison.cpp +++ b/Sources/OpenGraphCxx/Comparison/OGComparison.cpp @@ -1,9 +1,9 @@ // // OGCompareValues.cpp -// OpenGraph_SPI +// OpenGraphCxx -#include "OGComparison.h" -#include "OGComparisonPrivate.h" +#include +#include const void *OGComparisonStateGetDestination(OGComparisonState state) { return ((const OGComparisonStateStorage *)state)->destination; diff --git a/Sources/OpenGraph_SPI/Data/ClosureFunction.cpp b/Sources/OpenGraphCxx/Data/ClosureFunction.cpp similarity index 59% rename from Sources/OpenGraph_SPI/Data/ClosureFunction.cpp rename to Sources/OpenGraphCxx/Data/ClosureFunction.cpp index 10284101..7c4a02e0 100644 --- a/Sources/OpenGraph_SPI/Data/ClosureFunction.cpp +++ b/Sources/OpenGraphCxx/Data/ClosureFunction.cpp @@ -5,4 +5,4 @@ // Created by Kyle on 2024/3/6. // -#include "ClosureFunction.hpp" +#include diff --git a/Sources/OpenGraph_SPI/Data/OGUniqueID.c b/Sources/OpenGraphCxx/Data/OGUniqueID.c similarity index 80% rename from Sources/OpenGraph_SPI/Data/OGUniqueID.c rename to Sources/OpenGraphCxx/Data/OGUniqueID.c index cf4fa810..0657681c 100644 --- a/Sources/OpenGraph_SPI/Data/OGUniqueID.c +++ b/Sources/OpenGraphCxx/Data/OGUniqueID.c @@ -1,11 +1,11 @@ // // OGUniqueID.c -// OpenGraph_SPI +// OpenGraphCxx // // Audited for iOS 18.0 // Status: Complete -#include "OGUniqueID.h" +#include #include OGUniqueID OGMakeUniqueID(void) { diff --git a/Sources/OpenGraph_SPI/Data/table.cpp b/Sources/OpenGraphCxx/Data/table.cpp similarity index 97% rename from Sources/OpenGraph_SPI/Data/table.cpp rename to Sources/OpenGraphCxx/Data/table.cpp index 955fbee1..e916fa25 100644 --- a/Sources/OpenGraph_SPI/Data/table.cpp +++ b/Sources/OpenGraphCxx/Data/table.cpp @@ -1,16 +1,16 @@ // // table.cpp -// OpenGraph_SPI +// OpenGraphCxx // // Audited for iOS 18.0 // Status: WIP // Modified from https://github.com/jcmosc/Compute/blob/0a6b21a4cdeb9bbdd95e7e914c4e18bed37a2456/Sources/ComputeCxx/Data/Table.cpp [MIT License] -#include -#include "page.hpp" -#include "page_const.hpp" -#include "zone.hpp" -#include "../Util/assert.hpp" +#include +#include +#include +#include +#include #include #include #if OG_TARGET_OS_DARWIN diff --git a/Sources/OpenGraph_SPI/Data/zone.cpp b/Sources/OpenGraphCxx/Data/zone.cpp similarity index 95% rename from Sources/OpenGraph_SPI/Data/zone.cpp rename to Sources/OpenGraphCxx/Data/zone.cpp index a5a878e6..eb072c3f 100644 --- a/Sources/OpenGraph_SPI/Data/zone.cpp +++ b/Sources/OpenGraphCxx/Data/zone.cpp @@ -1,11 +1,11 @@ // // zone.cpp -// OpenGraph_SPI +// OpenGraphCxx -#include "zone.hpp" -#include -#include "page.hpp" -#include "../Util/assert.hpp" +#include +#include +#include +#include #if OG_TARGET_OS_DARWIN #include #else diff --git a/Sources/OpenGraph_SPI/Debug/OGDebugServer.cpp b/Sources/OpenGraphCxx/DebugServer/OGDebugServer.cpp similarity index 87% rename from Sources/OpenGraph_SPI/Debug/OGDebugServer.cpp rename to Sources/OpenGraphCxx/DebugServer/OGDebugServer.cpp index 3bd3cff9..407c0f7c 100644 --- a/Sources/OpenGraph_SPI/Debug/OGDebugServer.cpp +++ b/Sources/OpenGraphCxx/DebugServer/OGDebugServer.cpp @@ -5,8 +5,8 @@ // Created by Kyle on 2024/2/17. // -#include "OGDebugServer.h" -#include "og-debug-server.hpp" +#include +#include #if OG_TARGET_OS_DARWIN diff --git a/Sources/OpenGraph_SPI/Debug/og-debug-server.mm b/Sources/OpenGraphCxx/DebugServer/og-debug-server.mm similarity index 98% rename from Sources/OpenGraph_SPI/Debug/og-debug-server.mm rename to Sources/OpenGraphCxx/DebugServer/og-debug-server.mm index 1b5e6a56..7f301d13 100644 --- a/Sources/OpenGraph_SPI/Debug/og-debug-server.mm +++ b/Sources/OpenGraphCxx/DebugServer/og-debug-server.mm @@ -5,13 +5,13 @@ // Created by Kyle on 2024/1/11. // Audited for 2021 Release -#include "og-debug-server.hpp" +#include #if OG_TARGET_OS_DARWIN -#include "OGGraphDescription.h" -#include "../Util/log.hpp" -#include "../Util/assert.hpp" -#include "../Graph/Graph.hpp" +#include +#include +#include +#include #include #include diff --git a/Sources/OpenGraph_SPI/Graph/Graph.cpp b/Sources/OpenGraphCxx/Graph/Graph.cpp similarity index 89% rename from Sources/OpenGraph_SPI/Graph/Graph.cpp rename to Sources/OpenGraphCxx/Graph/Graph.cpp index 73c81a6f..36d40f6a 100644 --- a/Sources/OpenGraph_SPI/Graph/Graph.cpp +++ b/Sources/OpenGraphCxx/Graph/Graph.cpp @@ -1,10 +1,10 @@ // // Graph.cpp -// OpenGraph_SPI +// OpenGraphCxx -#include "Graph.hpp" -#include "Subgraph.hpp" -#include "OGGraphDescription.h" +#include +#include +#include #if !OG_TARGET_OS_WASI #include diff --git a/Sources/OpenGraph_SPI/Graph/Graph.mm b/Sources/OpenGraphCxx/Graph/Graph.mm similarity index 95% rename from Sources/OpenGraph_SPI/Graph/Graph.mm rename to Sources/OpenGraphCxx/Graph/Graph.mm index fd48afaa..06c6e887 100644 --- a/Sources/OpenGraph_SPI/Graph/Graph.mm +++ b/Sources/OpenGraphCxx/Graph/Graph.mm @@ -1,9 +1,9 @@ // // Graph.mm -// OpenGraph_SPI +// OpenGraphCxx -#include "Graph.hpp" -#include "OGGraphDescription.h" +#include +#include #if OG_OBJC_FOUNDATION #include diff --git a/Sources/OpenGraph_SPI/Graph/GraphContext.cpp b/Sources/OpenGraphCxx/Graph/GraphContext.cpp similarity index 86% rename from Sources/OpenGraph_SPI/Graph/GraphContext.cpp rename to Sources/OpenGraphCxx/Graph/GraphContext.cpp index b9b7b192..cf21346a 100644 --- a/Sources/OpenGraph_SPI/Graph/GraphContext.cpp +++ b/Sources/OpenGraphCxx/Graph/GraphContext.cpp @@ -5,9 +5,9 @@ // Created by Kyle on 2024/2/16. // -#include "Graph.hpp" -#include "OGGraph.h" -#include "../Util/assert.hpp" +#include +#include +#include OG::Graph::Context &OG::Graph::Context::from_cf(OGGraphRef storage) OG_NOEXCEPT { if (storage->context.isInvalid()) { diff --git a/Sources/OpenGraph_SPI/Graph/GraphDescription.cpp b/Sources/OpenGraphCxx/Graph/GraphDescription.cpp similarity index 81% rename from Sources/OpenGraph_SPI/Graph/GraphDescription.cpp rename to Sources/OpenGraphCxx/Graph/GraphDescription.cpp index a3b03e7b..44139547 100644 --- a/Sources/OpenGraph_SPI/Graph/GraphDescription.cpp +++ b/Sources/OpenGraphCxx/Graph/GraphDescription.cpp @@ -1,11 +1,11 @@ // // GraphDescription.cpp -// OpenGraph_SPI +// OpenGraphCxx -#include "OGGraphDescription.h" -#include "OGGraph.h" -#include "Graph.hpp" -#include "../Util/assert.hpp" +#include +#include +#include +#include CFTypeRef OGGraphDescription(OGGraphRef graph, CFDictionaryRef options) { #if OG_OBJC_FOUNDATION diff --git a/Sources/OpenGraph_SPI/Graph/GraphDescription.mm b/Sources/OpenGraphCxx/Graph/GraphDescription.mm similarity index 73% rename from Sources/OpenGraph_SPI/Graph/GraphDescription.mm rename to Sources/OpenGraphCxx/Graph/GraphDescription.mm index e6f26b87..e9773085 100644 --- a/Sources/OpenGraph_SPI/Graph/GraphDescription.mm +++ b/Sources/OpenGraphCxx/Graph/GraphDescription.mm @@ -1,11 +1,11 @@ // // GraphDescription.mm -// OpenGraph_SPI +// OpenGraphCxx -#include "OGGraphDescription.h" -#include "OGGraph.h" -#include "Graph.hpp" -#include "../Util/assert.hpp" +#include +#include +#include +#include #if OG_OBJC_FOUNDATION diff --git a/Sources/OpenGraph_SPI/Graph/OGGraph.cpp b/Sources/OpenGraphCxx/Graph/OGGraph.cpp similarity index 97% rename from Sources/OpenGraph_SPI/Graph/OGGraph.cpp rename to Sources/OpenGraphCxx/Graph/OGGraph.cpp index dde22526..c0087070 100644 --- a/Sources/OpenGraph_SPI/Graph/OGGraph.cpp +++ b/Sources/OpenGraphCxx/Graph/OGGraph.cpp @@ -5,10 +5,10 @@ // Created by Kyle on 2024/2/15. // -#include "OGGraph.h" -#include "Graph.hpp" -#include "../Util/assert.hpp" -#include "../Data/ClosureFunction.hpp" +#include +#include +#include +#include #include OGGraphRef OGGraphCreate() { diff --git a/Sources/OpenGraph_SPI/Graph/OGGraphContext.cpp b/Sources/OpenGraphCxx/Graph/OGGraphContext.cpp similarity index 74% rename from Sources/OpenGraph_SPI/Graph/OGGraphContext.cpp rename to Sources/OpenGraphCxx/Graph/OGGraphContext.cpp index af442f95..b876c752 100644 --- a/Sources/OpenGraph_SPI/Graph/OGGraphContext.cpp +++ b/Sources/OpenGraphCxx/Graph/OGGraphContext.cpp @@ -5,8 +5,8 @@ // Created by Kyle on 2024/2/16. // -#include "OGGraphContext.h" -#include "../Private/CFRuntime.h" +#include +#include OGGraphRef OGGraphContextGetGraph(OGGraphContextRef context) { return reinterpret_cast(reinterpret_cast(context) - sizeof(CFRuntimeBase)); diff --git a/Sources/OpenGraph_SPI/Graph/OGGraphTracing.cpp b/Sources/OpenGraphCxx/Graph/OGGraphTracing.cpp similarity index 86% rename from Sources/OpenGraph_SPI/Graph/OGGraphTracing.cpp rename to Sources/OpenGraphCxx/Graph/OGGraphTracing.cpp index 94a1e40a..f6071f3f 100644 --- a/Sources/OpenGraph_SPI/Graph/OGGraphTracing.cpp +++ b/Sources/OpenGraphCxx/Graph/OGGraphTracing.cpp @@ -1,8 +1,8 @@ // // OGGraphTracing.mm -// OpenGraph_SPI +// OpenGraphCxx -#include "OGGraphTracing.h" +#include void OGGraphStartTracing(_Nullable OGGraphRef graph, OGGraphTraceFlags options) { OGGraphStartTracing2(graph, options, NULL); diff --git a/Sources/OpenGraph_SPI/Graph/OGSubgraph.cpp b/Sources/OpenGraphCxx/Graph/OGSubgraph.cpp similarity index 96% rename from Sources/OpenGraph_SPI/Graph/OGSubgraph.cpp rename to Sources/OpenGraphCxx/Graph/OGSubgraph.cpp index 8aaa4b76..daad1a88 100644 --- a/Sources/OpenGraph_SPI/Graph/OGSubgraph.cpp +++ b/Sources/OpenGraphCxx/Graph/OGSubgraph.cpp @@ -5,12 +5,12 @@ // Created by Kyle on 2024/2/15. // -#include "OGSubgraph.h" -#include "OGGraph.h" -#include "Subgraph.hpp" -#include "OGGraphContext.h" -#include "../Util/assert.hpp" -#include "../Util/env.hpp" +#include +#include +#include +#include +#include +#include #include #if !OG_TARGET_OS_WASI #include diff --git a/Sources/OpenGraph_SPI/Graph/Subgraph.cpp b/Sources/OpenGraphCxx/Graph/Subgraph.cpp similarity index 94% rename from Sources/OpenGraph_SPI/Graph/Subgraph.cpp rename to Sources/OpenGraphCxx/Graph/Subgraph.cpp index 43588802..82ad4dc1 100644 --- a/Sources/OpenGraph_SPI/Graph/Subgraph.cpp +++ b/Sources/OpenGraphCxx/Graph/Subgraph.cpp @@ -5,8 +5,8 @@ // Created by Kyle on 2024/2/15. // -#include "Subgraph.hpp" -#include "OGSubgraph.h" +#include +#include pthread_key_t OG::Subgraph::_current_subgraph_key; diff --git a/Sources/OpenGraph_SPI/Graph/Subgraph.hpp b/Sources/OpenGraphCxx/Graph/Subgraph.hpp similarity index 93% rename from Sources/OpenGraph_SPI/Graph/Subgraph.hpp rename to Sources/OpenGraphCxx/Graph/Subgraph.hpp index 9fa62e5e..9f196391 100644 --- a/Sources/OpenGraph_SPI/Graph/Subgraph.hpp +++ b/Sources/OpenGraphCxx/Graph/Subgraph.hpp @@ -9,10 +9,10 @@ #define Subgraph_hpp #include "OGBase.h" -#include "Graph.hpp" -#include "../Attribute/AttributeID.hpp" -#include "../Data/ClosureFunction.hpp" -#include "../Runtime/metadata.hpp" +#include +#include +#include +#include #include typedef struct OG_BRIDGED_TYPE(id) OGSubgraphStorage * OGSubgraphRef; diff --git a/Sources/OpenGraph_SPI/Runtime/OGTupleType.cpp b/Sources/OpenGraphCxx/Runtime/OGTupleType.cpp similarity index 98% rename from Sources/OpenGraph_SPI/Runtime/OGTupleType.cpp rename to Sources/OpenGraphCxx/Runtime/OGTupleType.cpp index 22b95809..23b4dd1e 100644 --- a/Sources/OpenGraph_SPI/Runtime/OGTupleType.cpp +++ b/Sources/OpenGraphCxx/Runtime/OGTupleType.cpp @@ -1,13 +1,13 @@ // // OGTupleType.cpp -// OpenGraph_SPI +// OpenGraphCxx // // Audited for iOS 18.0 // Status: Complete -#include "OGTupleType.h" -#include "metadata.hpp" -#include "../Util/assert.hpp" +#include +#include +#include #ifdef OPENGRAPH_SWIFT_TOOLCHAIN_SUPPORTED #include diff --git a/Sources/OpenGraph_SPI/Runtime/OGTypeID.cpp b/Sources/OpenGraphCxx/Runtime/OGTypeID.cpp similarity index 97% rename from Sources/OpenGraph_SPI/Runtime/OGTypeID.cpp rename to Sources/OpenGraphCxx/Runtime/OGTypeID.cpp index 47832805..3d4873eb 100644 --- a/Sources/OpenGraph_SPI/Runtime/OGTypeID.cpp +++ b/Sources/OpenGraphCxx/Runtime/OGTypeID.cpp @@ -1,13 +1,13 @@ // // OGTypeID.cpp -// OpenGraph_SPI +// OpenGraphCxx // // Audited for iOS 18.0 // Status: WIP -#include "OGTypeID.h" -#include "metadata.hpp" -#include "../Util/assert.hpp" +#include +#include +#include #ifdef OPENGRAPH_SWIFT_TOOLCHAIN_SUPPORTED #include diff --git a/Sources/OpenGraph_SPI/Runtime/metadata.cpp b/Sources/OpenGraphCxx/Runtime/metadata.cpp similarity index 82% rename from Sources/OpenGraph_SPI/Runtime/metadata.cpp rename to Sources/OpenGraphCxx/Runtime/metadata.cpp index 0c00d54c..dd7217f5 100644 --- a/Sources/OpenGraph_SPI/Runtime/metadata.cpp +++ b/Sources/OpenGraphCxx/Runtime/metadata.cpp @@ -1,11 +1,11 @@ // // metadata.cpp -// OpenGraph_SPI +// OpenGraphCxx // // Audited for iOS 18.0 // Status: WIP -#include "metadata.hpp" +#include #ifdef OPENGRAPH_SWIFT_TOOLCHAIN_SUPPORTED diff --git a/Sources/OpenGraph_SPI/Util/assert.cpp b/Sources/OpenGraphCxx/Util/assert.cpp similarity index 93% rename from Sources/OpenGraph_SPI/Util/assert.cpp rename to Sources/OpenGraphCxx/Util/assert.cpp index e6b64df2..21cbccc3 100644 --- a/Sources/OpenGraph_SPI/Util/assert.cpp +++ b/Sources/OpenGraphCxx/Util/assert.cpp @@ -5,8 +5,8 @@ // Created by Kyle on 2024/1/21. // -#include "assert.hpp" -#include "log.hpp" +#include +#include #include #include diff --git a/Sources/OpenGraph_SPI/Util/log.cpp b/Sources/OpenGraphCxx/Util/log.cpp similarity index 92% rename from Sources/OpenGraph_SPI/Util/log.cpp rename to Sources/OpenGraphCxx/Util/log.cpp index ea52f1ee..80428465 100644 --- a/Sources/OpenGraph_SPI/Util/log.cpp +++ b/Sources/OpenGraphCxx/Util/log.cpp @@ -5,7 +5,7 @@ // Created by Kyle on 2024/1/12. // Audited for 2021 Release -#include "log.hpp" +#include #if OG_TARGET_OS_DARWIN diff --git a/Sources/OpenGraph_SPI/Util/realloc_vector.cpp b/Sources/OpenGraphCxx/Util/realloc_vector.cpp similarity index 95% rename from Sources/OpenGraph_SPI/Util/realloc_vector.cpp rename to Sources/OpenGraphCxx/Util/realloc_vector.cpp index 2dff26d3..be8b1daa 100644 --- a/Sources/OpenGraph_SPI/Util/realloc_vector.cpp +++ b/Sources/OpenGraphCxx/Util/realloc_vector.cpp @@ -5,8 +5,8 @@ // Created by Kyle on 2024/1/17. // -#include "realloc_vector.hpp" -#include "assert.hpp" +#include +#include #if OG_TARGET_OS_DARWIN #include diff --git a/Sources/OpenGraph_SPI/Version/OGVersion.c b/Sources/OpenGraphCxx/Version/OGVersion.c similarity index 90% rename from Sources/OpenGraph_SPI/Version/OGVersion.c rename to Sources/OpenGraphCxx/Version/OGVersion.c index 42e3d8de..00e51f39 100644 --- a/Sources/OpenGraph_SPI/Version/OGVersion.c +++ b/Sources/OpenGraphCxx/Version/OGVersion.c @@ -2,8 +2,8 @@ // OGVersion.c // OpenGraph -#include "OGBase.h" -#include "OGVersion.h" +#include +#include #if OPENGRAPH_RELEASE == OPENGRAPH_RELEASE_2024 const double OpenGraphVersionNumber __attribute__ ((used)) = (double)6.0; diff --git a/Sources/OpenGraph_SPI/include/OGAttribute.h b/Sources/OpenGraphCxx/include/OpenGraphC/OGAttribute.h similarity index 92% rename from Sources/OpenGraph_SPI/include/OGAttribute.h rename to Sources/OpenGraphCxx/include/OpenGraphC/OGAttribute.h index 628ac6dd..b3e0225a 100644 --- a/Sources/OpenGraph_SPI/include/OGAttribute.h +++ b/Sources/OpenGraphCxx/include/OpenGraphC/OGAttribute.h @@ -1,20 +1,20 @@ // // OGAttribute.h -// OpenGraph_SPI +// OpenGraphCxx #ifndef OGAttribute_h #define OGAttribute_h -#include "OGBase.h" -#include "OGAttributeInfo.h" -#include "OGAttributeFlags.h" -#include "OGCachedValueOptions.h" -#include "OGGraph.h" -#include "OGInputOptions.h" -#include "OGTypeID.h" -#include "OGValue.h" -#include "OGValueOptions.h" -#include "OGValueState.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include OG_ASSUME_NONNULL_BEGIN diff --git a/Sources/OpenGraph_SPI/include/OGAttributeFlags.h b/Sources/OpenGraphCxx/include/OpenGraphC/OGAttributeFlags.h similarity index 89% rename from Sources/OpenGraph_SPI/include/OGAttributeFlags.h rename to Sources/OpenGraphCxx/include/OpenGraphC/OGAttributeFlags.h index 03c89dd6..8f3958b3 100644 --- a/Sources/OpenGraph_SPI/include/OGAttributeFlags.h +++ b/Sources/OpenGraphCxx/include/OpenGraphC/OGAttributeFlags.h @@ -1,6 +1,6 @@ // // OGAttributeFlags.h -// OpenGraph_SPI +// OpenGraphCxx // // Audited for RELEASE_2021 // Status: Complete @@ -8,7 +8,7 @@ #ifndef OGAttributeFlags_h #define OGAttributeFlags_h -#include "OGBase.h" +#include typedef OG_OPTIONS(uint32_t, OGAttributeFlags) { OGAttributeFlagsDefault = 0, diff --git a/Sources/OpenGraph_SPI/include/OGAttributeInfo.h b/Sources/OpenGraphCxx/include/OpenGraphC/OGAttributeInfo.h similarity index 81% rename from Sources/OpenGraph_SPI/include/OGAttributeInfo.h rename to Sources/OpenGraphCxx/include/OpenGraphC/OGAttributeInfo.h index a9994df5..2bc54f07 100644 --- a/Sources/OpenGraph_SPI/include/OGAttributeInfo.h +++ b/Sources/OpenGraphCxx/include/OpenGraphC/OGAttributeInfo.h @@ -8,8 +8,8 @@ #ifndef OGAttributeInfo_h #define OGAttributeInfo_h -#include "OGBase.h" -#include "OGAttributeType.h" +#include +#include OG_ASSUME_NONNULL_BEGIN diff --git a/Sources/OpenGraph_SPI/include/OGAttributeType.h b/Sources/OpenGraphCxx/include/OpenGraphC/OGAttributeType.h similarity index 76% rename from Sources/OpenGraph_SPI/include/OGAttributeType.h rename to Sources/OpenGraphCxx/include/OpenGraphC/OGAttributeType.h index b2c03ab3..e255b976 100644 --- a/Sources/OpenGraph_SPI/include/OGAttributeType.h +++ b/Sources/OpenGraphCxx/include/OpenGraphC/OGAttributeType.h @@ -1,12 +1,12 @@ // // OGAttributeType.h -// OpenGraph_SPI +// OpenGraphCxx #ifndef OGAttributeType_h #define OGAttributeType_h -#include "OGBase.h" -#include "OGTypeID.h" +#include +#include OG_ASSUME_NONNULL_BEGIN diff --git a/Sources/OpenGraph_SPI/include/OGAttributeTypeFlags.h b/Sources/OpenGraphCxx/include/OpenGraphC/OGAttributeTypeFlags.h similarity index 90% rename from Sources/OpenGraph_SPI/include/OGAttributeTypeFlags.h rename to Sources/OpenGraphCxx/include/OpenGraphC/OGAttributeTypeFlags.h index 61c09a4f..912d2351 100644 --- a/Sources/OpenGraph_SPI/include/OGAttributeTypeFlags.h +++ b/Sources/OpenGraphCxx/include/OpenGraphC/OGAttributeTypeFlags.h @@ -1,11 +1,11 @@ // // OGAttributeTypeFlags.h -// OpenGraph_SPI +// OpenGraphCxx #ifndef OGAttributeTypeFlags_h #define OGAttributeTypeFlags_h -#include "OGBase.h" +#include typedef OG_OPTIONS(uint32_t, OGAttributeTypeFlags) { OGAttributeTypeFlagsDefault = 0, diff --git a/Sources/OpenGraph_SPI/include/OGBase.h b/Sources/OpenGraphCxx/include/OpenGraphC/OGBase.h similarity index 99% rename from Sources/OpenGraph_SPI/include/OGBase.h rename to Sources/OpenGraphCxx/include/OpenGraphC/OGBase.h index f77340a2..8cec261b 100644 --- a/Sources/OpenGraph_SPI/include/OGBase.h +++ b/Sources/OpenGraphCxx/include/OpenGraphC/OGBase.h @@ -1,6 +1,6 @@ // // OGBase.h -// OpenGraph_SPI +// OpenGraphCxx #ifndef OGBase_h #define OGBase_h diff --git a/Sources/OpenGraph_SPI/include/OGCachedValueOptions.h b/Sources/OpenGraphCxx/include/OpenGraphC/OGCachedValueOptions.h similarity index 89% rename from Sources/OpenGraph_SPI/include/OGCachedValueOptions.h rename to Sources/OpenGraphCxx/include/OpenGraphC/OGCachedValueOptions.h index b53de723..f5185f31 100644 --- a/Sources/OpenGraph_SPI/include/OGCachedValueOptions.h +++ b/Sources/OpenGraphCxx/include/OpenGraphC/OGCachedValueOptions.h @@ -1,11 +1,11 @@ // // OGCachedValueOptions.h -// OpenGraph_SPI +// OpenGraphCxx #ifndef OGCachedValueOptions_h #define OGCachedValueOptions_h -#include "OGBase.h" +#include typedef OG_OPTIONS(uint32_t, OGCachedValueOptions) { OGCachedValueOptions_0 = 0, diff --git a/Sources/OpenGraph_SPI/include/OGChangedValueFlags.h b/Sources/OpenGraphCxx/include/OpenGraphC/OGChangedValueFlags.h similarity index 84% rename from Sources/OpenGraph_SPI/include/OGChangedValueFlags.h rename to Sources/OpenGraphCxx/include/OpenGraphC/OGChangedValueFlags.h index cd7af2a4..a6b8d7dc 100644 --- a/Sources/OpenGraph_SPI/include/OGChangedValueFlags.h +++ b/Sources/OpenGraphCxx/include/OpenGraphC/OGChangedValueFlags.h @@ -1,11 +1,11 @@ // // OGChangedValueFlags.h -// OpenGraph_SPI +// OpenGraphCxx #ifndef OGChangedValueFlags_h #define OGChangedValueFlags_h -#include "OGBase.h" +#include typedef OG_OPTIONS(uint32_t, OGChangedValueFlags) { OGChangedValueFlags_1 = 1 << 0, diff --git a/Sources/OpenGraph_SPI/include/OGComparison.h b/Sources/OpenGraphCxx/include/OpenGraphC/OGComparison.h similarity index 97% rename from Sources/OpenGraph_SPI/include/OGComparison.h rename to Sources/OpenGraphCxx/include/OpenGraphC/OGComparison.h index 22e63ab2..83b7b8b5 100644 --- a/Sources/OpenGraph_SPI/include/OGComparison.h +++ b/Sources/OpenGraphCxx/include/OpenGraphC/OGComparison.h @@ -1,6 +1,6 @@ // // OGComparison.h -// OpenGraph_SPI +// OpenGraphCxx // // Audited for 6.5.4 // Status: Complete @@ -30,8 +30,8 @@ #ifndef OGComparison_h #define OGComparison_h -#include "OGBase.h" -#include "OGTypeID.h" +#include +#include OG_ASSUME_NONNULL_BEGIN diff --git a/Sources/OpenGraph_SPI/include/OGCounterQueryType.h b/Sources/OpenGraphCxx/include/OpenGraphC/OGCounterQueryType.h similarity index 90% rename from Sources/OpenGraph_SPI/include/OGCounterQueryType.h rename to Sources/OpenGraphCxx/include/OpenGraphC/OGCounterQueryType.h index ad87b096..96e65295 100644 --- a/Sources/OpenGraph_SPI/include/OGCounterQueryType.h +++ b/Sources/OpenGraphCxx/include/OpenGraphC/OGCounterQueryType.h @@ -1,11 +1,11 @@ // // OGCounterQueryType.h -// OpenGraph_SPI +// OpenGraphCxx #ifndef OGCounterQueryType_h #define OGCounterQueryType_h -#include "OGBase.h" +#include typedef OG_ENUM(uint32_t, OGCounterQueryType) { OGCounterQueryType_0, diff --git a/Sources/OpenGraph_SPI/include/OGDebugServer.h b/Sources/OpenGraphCxx/include/OpenGraphC/OGDebugServer.h similarity index 94% rename from Sources/OpenGraph_SPI/include/OGDebugServer.h rename to Sources/OpenGraphCxx/include/OpenGraphC/OGDebugServer.h index 6cc209a7..327295ea 100644 --- a/Sources/OpenGraph_SPI/include/OGDebugServer.h +++ b/Sources/OpenGraphCxx/include/OpenGraphC/OGDebugServer.h @@ -1,11 +1,11 @@ // // OGDebugServer.h -// OpenGraph_SPI +// OpenGraphCxx #ifndef OGDebugServer_h #define OGDebugServer_h -#include "OGBase.h" +#include #if OG_TARGET_OS_DARWIN diff --git a/Sources/OpenGraph_SPI/include/OGGraph.h b/Sources/OpenGraphCxx/include/OpenGraphC/OGGraph.h similarity index 96% rename from Sources/OpenGraph_SPI/include/OGGraph.h rename to Sources/OpenGraphCxx/include/OpenGraphC/OGGraph.h index 49c67a72..f61896ca 100644 --- a/Sources/OpenGraph_SPI/include/OGGraph.h +++ b/Sources/OpenGraphCxx/include/OpenGraphC/OGGraph.h @@ -1,13 +1,13 @@ // // OGGraph.h -// OpenGraph_SPI +// OpenGraphCxx #ifndef OGGraph_h #define OGGraph_h -#include "OGBase.h" -#include "../Private/CFRuntime.h" -#include "OGCounterQueryType.h" +#include +#include +#include // Note: Place all structure declaration in a single place to avoid header cycle dependency diff --git a/Sources/OpenGraph_SPI/include/OGGraphContext.h b/Sources/OpenGraphCxx/include/OpenGraphC/OGGraphContext.h similarity index 84% rename from Sources/OpenGraph_SPI/include/OGGraphContext.h rename to Sources/OpenGraphCxx/include/OpenGraphC/OGGraphContext.h index b078e42b..19cf064a 100644 --- a/Sources/OpenGraph_SPI/include/OGGraphContext.h +++ b/Sources/OpenGraphCxx/include/OpenGraphC/OGGraphContext.h @@ -1,12 +1,12 @@ // // OGGraphContext.h -// OpenGraph_SPI +// OpenGraphCxx #ifndef OGGraphContext_h #define OGGraphContext_h -#include "OGBase.h" -#include "OGGraph.h" +#include +#include // MARK: - Exported C functions diff --git a/Sources/OpenGraph_SPI/include/OGGraphDescription.h b/Sources/OpenGraphCxx/include/OpenGraphC/OGGraphDescription.h similarity index 94% rename from Sources/OpenGraph_SPI/include/OGGraphDescription.h rename to Sources/OpenGraphCxx/include/OpenGraphC/OGGraphDescription.h index b755d784..fd74e5e3 100644 --- a/Sources/OpenGraph_SPI/include/OGGraphDescription.h +++ b/Sources/OpenGraphCxx/include/OpenGraphC/OGGraphDescription.h @@ -1,12 +1,12 @@ // // OGGraphDescription.h -// OpenGraph_SPI +// OpenGraphCxx #ifndef OGGraphDescription_h #define OGGraphDescription_h -#include "OGBase.h" -#include "OGGraph.h" +#include +#include OG_ASSUME_NONNULL_BEGIN diff --git a/Sources/OpenGraph_SPI/include/OGGraphTracing.h b/Sources/OpenGraphCxx/include/OpenGraphC/OGGraphTracing.h similarity index 91% rename from Sources/OpenGraph_SPI/include/OGGraphTracing.h rename to Sources/OpenGraphCxx/include/OpenGraphC/OGGraphTracing.h index 647afb1a..fc4c5633 100644 --- a/Sources/OpenGraph_SPI/include/OGGraphTracing.h +++ b/Sources/OpenGraphCxx/include/OpenGraphC/OGGraphTracing.h @@ -1,12 +1,12 @@ // // OGGraphTracing.h -// OpenGraph_SPI +// OpenGraphCxx #ifndef OGGraphTracing_hpp #define OGGraphTracing_hpp -#include "OGBase.h" -#include "OGGraph.h" +#include +#include typedef OG_OPTIONS(uint32_t, OGGraphTraceFlags) { OGGraphTraceFlags_0 = 0, diff --git a/Sources/OpenGraph_SPI/include/OGInputOptions.h b/Sources/OpenGraphCxx/include/OpenGraphC/OGInputOptions.h similarity index 81% rename from Sources/OpenGraph_SPI/include/OGInputOptions.h rename to Sources/OpenGraphCxx/include/OpenGraphC/OGInputOptions.h index d71741fc..a49881a3 100644 --- a/Sources/OpenGraph_SPI/include/OGInputOptions.h +++ b/Sources/OpenGraphCxx/include/OpenGraphC/OGInputOptions.h @@ -1,11 +1,11 @@ // // OGInputOptions.h -// OpenGraph_SPI +// OpenGraphCxx #ifndef OGInputOptions_h #define OGInputOptions_h -#include "OGBase.h" +#include typedef OG_OPTIONS(uint32_t, OGInputOptions) { OGInputOptions_0 = 0, diff --git a/Sources/OpenGraph_SPI/include/OGSearchOptions.h b/Sources/OpenGraphCxx/include/OpenGraphC/OGSearchOptions.h similarity index 81% rename from Sources/OpenGraph_SPI/include/OGSearchOptions.h rename to Sources/OpenGraphCxx/include/OpenGraphC/OGSearchOptions.h index 4e9c2f03..aba0e1b9 100644 --- a/Sources/OpenGraph_SPI/include/OGSearchOptions.h +++ b/Sources/OpenGraphCxx/include/OpenGraphC/OGSearchOptions.h @@ -1,11 +1,11 @@ // // OGSearchOptions.h -// OpenGraph_SPI +// OpenGraphCxx #ifndef OGSearchOptions_h #define OGSearchOptions_h -#include "OGBase.h" +#include typedef OG_OPTIONS(uint32_t, OGSearchOptions) { OGSearchOptions_0 = 0, diff --git a/Sources/OpenGraph_SPI/include/OGSubgraph.h b/Sources/OpenGraphCxx/include/OpenGraphC/OGSubgraph.h similarity index 93% rename from Sources/OpenGraph_SPI/include/OGSubgraph.h rename to Sources/OpenGraphCxx/include/OpenGraphC/OGSubgraph.h index 598c9915..6fb5b444 100644 --- a/Sources/OpenGraph_SPI/include/OGSubgraph.h +++ b/Sources/OpenGraphCxx/include/OpenGraphC/OGSubgraph.h @@ -1,16 +1,16 @@ // // OGSubgraph.h -// OpenGraph_SPI +// OpenGraphCxx #ifndef OGSubgraph_h #define OGSubgraph_h -#include "OGAttribute.h" -#include "OGAttributeFlags.h" -#include "OGBase.h" -#include "OGGraph.h" -#include "OGUniqueID.h" -#include "../Private/CFRuntime.h" +#include +#include +#include +#include +#include +#include OG_ASSUME_NONNULL_BEGIN diff --git a/Sources/OpenGraph_SPI/include/OGSwiftSupport.h b/Sources/OpenGraphCxx/include/OpenGraphC/OGSwiftSupport.h similarity index 98% rename from Sources/OpenGraph_SPI/include/OGSwiftSupport.h rename to Sources/OpenGraphCxx/include/OpenGraphC/OGSwiftSupport.h index 46efbb26..82c52787 100644 --- a/Sources/OpenGraph_SPI/include/OGSwiftSupport.h +++ b/Sources/OpenGraphCxx/include/OpenGraphC/OGSwiftSupport.h @@ -1,6 +1,6 @@ // // OGSwiftSupport.h -// OpenGraph_SPI +// OpenGraphCxx #ifndef OGSwiftSupport_h #define OGSwiftSupport_h diff --git a/Sources/OpenGraph_SPI/include/OGTargetConditionals.h b/Sources/OpenGraphCxx/include/OpenGraphC/OGTargetConditionals.h similarity index 100% rename from Sources/OpenGraph_SPI/include/OGTargetConditionals.h rename to Sources/OpenGraphCxx/include/OpenGraphC/OGTargetConditionals.h diff --git a/Sources/OpenGraph_SPI/include/OGTupleType.h b/Sources/OpenGraphCxx/include/OpenGraphC/OGTupleType.h similarity index 97% rename from Sources/OpenGraph_SPI/include/OGTupleType.h rename to Sources/OpenGraphCxx/include/OpenGraphC/OGTupleType.h index f62eba74..460ec901 100644 --- a/Sources/OpenGraph_SPI/include/OGTupleType.h +++ b/Sources/OpenGraphCxx/include/OpenGraphC/OGTupleType.h @@ -1,6 +1,6 @@ // // OGTupleType.h -// OpenGraph_SPI +// OpenGraphCxx // // Audited for iOS 18.0 // Status: Complete @@ -8,8 +8,8 @@ #ifndef OGTupleType_h #define OGTupleType_h -#include "OGBase.h" -#include "OGTypeID.h" +#include +#include OG_ASSUME_NONNULL_BEGIN diff --git a/Sources/OpenGraph_SPI/include/OGTypeID.h b/Sources/OpenGraphCxx/include/OpenGraphC/OGTypeID.h similarity index 97% rename from Sources/OpenGraph_SPI/include/OGTypeID.h rename to Sources/OpenGraphCxx/include/OpenGraphC/OGTypeID.h index 2d718c6d..8ed9b4a6 100644 --- a/Sources/OpenGraph_SPI/include/OGTypeID.h +++ b/Sources/OpenGraphCxx/include/OpenGraphC/OGTypeID.h @@ -1,6 +1,6 @@ // // OGTypeID.h -// OpenGraph_SPI +// OpenGraphCxx // // Audited for iOS 18.0 // Status: Complete @@ -8,8 +8,8 @@ #ifndef OGTypeID_h #define OGTypeID_h -#include "OGBase.h" -#include "OGVersion.h" +#include +#include OG_ASSUME_NONNULL_BEGIN diff --git a/Sources/OpenGraph_SPI/include/OGUniqueID.h b/Sources/OpenGraphCxx/include/OpenGraphC/OGUniqueID.h similarity index 86% rename from Sources/OpenGraph_SPI/include/OGUniqueID.h rename to Sources/OpenGraphCxx/include/OpenGraphC/OGUniqueID.h index f0348c92..220a4267 100644 --- a/Sources/OpenGraph_SPI/include/OGUniqueID.h +++ b/Sources/OpenGraphCxx/include/OpenGraphC/OGUniqueID.h @@ -1,6 +1,6 @@ // // OGMakeUniqueID.h -// OpenGraph_SPI +// OpenGraphCxx // // Audited for iOS 18.0 // Status: Complete @@ -8,7 +8,7 @@ #ifndef OGMakeUniqueID_h #define OGMakeUniqueID_h -#include "OGBase.h" +#include typedef long OGUniqueID; OG_EXTERN_C_BEGIN diff --git a/Sources/OpenGraph_SPI/include/OGValue.h b/Sources/OpenGraphCxx/include/OpenGraphC/OGValue.h similarity index 81% rename from Sources/OpenGraph_SPI/include/OGValue.h rename to Sources/OpenGraphCxx/include/OpenGraphC/OGValue.h index cea55304..f83a5226 100644 --- a/Sources/OpenGraph_SPI/include/OGValue.h +++ b/Sources/OpenGraphCxx/include/OpenGraphC/OGValue.h @@ -1,11 +1,11 @@ // // OGValue.h -// OpenGraph_SPI +// OpenGraphCxx #ifndef OGValue_h #define OGValue_h -#include "OGBase.h" +#include OG_ASSUME_NONNULL_BEGIN diff --git a/Sources/OpenGraph_SPI/include/OGValueOptions.h b/Sources/OpenGraphCxx/include/OpenGraphC/OGValueOptions.h similarity index 83% rename from Sources/OpenGraph_SPI/include/OGValueOptions.h rename to Sources/OpenGraphCxx/include/OpenGraphC/OGValueOptions.h index 652dd407..a12d9080 100644 --- a/Sources/OpenGraph_SPI/include/OGValueOptions.h +++ b/Sources/OpenGraphCxx/include/OpenGraphC/OGValueOptions.h @@ -1,11 +1,11 @@ // // OGValueOptions.h -// OpenGraph_SPI +// OpenGraphCxx #ifndef OGValueOptions_h #define OGValueOptions_h -#include "OGBase.h" +#include typedef OG_OPTIONS(uint32_t, OGValueOptions) { OGValueOptions_0 = 0, diff --git a/Sources/OpenGraph_SPI/include/OGValueState.h b/Sources/OpenGraphCxx/include/OpenGraphC/OGValueState.h similarity index 81% rename from Sources/OpenGraph_SPI/include/OGValueState.h rename to Sources/OpenGraphCxx/include/OpenGraphC/OGValueState.h index aa4b81ad..2a5ba371 100644 --- a/Sources/OpenGraph_SPI/include/OGValueState.h +++ b/Sources/OpenGraphCxx/include/OpenGraphC/OGValueState.h @@ -1,11 +1,11 @@ // // OGValueState.h -// OpenGraph_SPI +// OpenGraphCxx #ifndef OGValueState_h #define OGValueState_h -#include "OGBase.h" +#include OG_ASSUME_NONNULL_BEGIN diff --git a/Sources/OpenGraph_SPI/include/OGVersion.h b/Sources/OpenGraphCxx/include/OpenGraphC/OGVersion.h similarity index 86% rename from Sources/OpenGraph_SPI/include/OGVersion.h rename to Sources/OpenGraphCxx/include/OpenGraphC/OGVersion.h index 13f094db..5fd7c6f2 100644 --- a/Sources/OpenGraph_SPI/include/OGVersion.h +++ b/Sources/OpenGraphCxx/include/OpenGraphC/OGVersion.h @@ -1,11 +1,11 @@ // // OGVersion.h -// OpenGraph_SPI +// OpenGraphCxx #ifndef OGVersion_h #define OGVersion_h -#include "OGBase.h" +#include #define OPENGRAPH_RELEASE_2021 2021 #define OPENGRAPH_RELEASE_2024 2024 diff --git a/Sources/OpenGraph_SPI/include/OGWeakAttribute.h b/Sources/OpenGraphCxx/include/OpenGraphC/OGWeakAttribute.h similarity index 88% rename from Sources/OpenGraph_SPI/include/OGWeakAttribute.h rename to Sources/OpenGraphCxx/include/OpenGraphC/OGWeakAttribute.h index 7b2472e6..ada838fc 100644 --- a/Sources/OpenGraph_SPI/include/OGWeakAttribute.h +++ b/Sources/OpenGraphCxx/include/OpenGraphC/OGWeakAttribute.h @@ -1,12 +1,12 @@ // // OGWeakAttribute.h -// OpenGraph_SPI +// OpenGraphCxx #ifndef OGWeakAttribute_hpp #define OGWeakAttribute_hpp -#include "OGBase.h" -#include "OGAttribute.h" +#include +#include OG_ASSUME_NONNULL_BEGIN diff --git a/Sources/OpenGraphCxx/include/OpenGraphC/OpenGraph-umbrella.h b/Sources/OpenGraphCxx/include/OpenGraphC/OpenGraph-umbrella.h new file mode 100644 index 00000000..a434825f --- /dev/null +++ b/Sources/OpenGraphCxx/include/OpenGraphC/OpenGraph-umbrella.h @@ -0,0 +1,29 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +OG_EXPORT double OpenGraphVersionNumber; +OG_EXPORT const unsigned char OpenGraphVersionString[]; diff --git a/Sources/OpenGraph_SPI/Private/CFRuntime.h b/Sources/OpenGraphCxx/include/OpenGraphC/Private/CFRuntime.h similarity index 99% rename from Sources/OpenGraph_SPI/Private/CFRuntime.h rename to Sources/OpenGraphCxx/include/OpenGraphC/Private/CFRuntime.h index 958c9d88..b9565aa0 100644 --- a/Sources/OpenGraph_SPI/Private/CFRuntime.h +++ b/Sources/OpenGraphCxx/include/OpenGraphC/Private/CFRuntime.h @@ -1,4 +1,4 @@ -#include "OGBase.h" +#include #if OG_TARGET_OS_DARWIN // Copied from https://github.com/apple/swift-corelibs-foundation/blob/d8e8a8b92b3a8af8381a11155328c1bba1c6bd2c/CoreFoundation/Base.subproj/CFRuntime.h /* CFRuntime.h diff --git a/Sources/OpenGraph_SPI/Attribute/AttributeID.hpp b/Sources/OpenGraphCxx/include/OpenGraphCxx/Attribute/AttributeID.hpp similarity index 94% rename from Sources/OpenGraph_SPI/Attribute/AttributeID.hpp rename to Sources/OpenGraphCxx/include/OpenGraphCxx/Attribute/AttributeID.hpp index de4138ca..09bb09e9 100644 --- a/Sources/OpenGraph_SPI/Attribute/AttributeID.hpp +++ b/Sources/OpenGraphCxx/include/OpenGraphCxx/Attribute/AttributeID.hpp @@ -8,9 +8,9 @@ #ifndef AttributeID_hpp #define AttributeID_hpp -#include "OGBase.h" -#include "OGAttribute.h" -#include "../Util/assert.hpp" +#include +#include +#include namespace OG { class AttributeID final { diff --git a/Sources/OpenGraph_SPI/Attribute/AttributeType.hpp b/Sources/OpenGraphCxx/include/OpenGraphCxx/Attribute/AttributeType.hpp similarity index 54% rename from Sources/OpenGraph_SPI/Attribute/AttributeType.hpp rename to Sources/OpenGraphCxx/include/OpenGraphCxx/Attribute/AttributeType.hpp index 8deffb3b..05c8e494 100644 --- a/Sources/OpenGraph_SPI/Attribute/AttributeType.hpp +++ b/Sources/OpenGraphCxx/include/OpenGraphCxx/Attribute/AttributeType.hpp @@ -1,19 +1,16 @@ // // AttributeType.hpp -// -// -// Created by Kyle on 2024/2/17. -// +// OpenGraphCxx #ifndef AttributeType_hpp #define AttributeType_hpp -#include "OGBase.h" -#include "OGAttributeType.h" +#include +#include namespace OG { struct AttributeType { OGAttributeType storage; }; } -#endif /* AttributeType_2_hpp */ +#endif /* AttributeType_hpp */ diff --git a/Sources/OpenGraph_SPI/Comparison/OGComparisonPrivate.h b/Sources/OpenGraphCxx/include/OpenGraphCxx/Comparison/OGComparisonPrivate.h similarity index 93% rename from Sources/OpenGraph_SPI/Comparison/OGComparisonPrivate.h rename to Sources/OpenGraphCxx/include/OpenGraphCxx/Comparison/OGComparisonPrivate.h index 2981b7e8..2595f6e2 100644 --- a/Sources/OpenGraph_SPI/Comparison/OGComparisonPrivate.h +++ b/Sources/OpenGraphCxx/include/OpenGraphCxx/Comparison/OGComparisonPrivate.h @@ -1,6 +1,6 @@ // // OGComparisonPrivate.h -// OpenGraph_SPI +// OpenGraphCxx // // Audited for 6.5.4 // Status: Complete @@ -29,9 +29,9 @@ #ifndef OGComparisonPrivate_h #define OGComparisonPrivate_h -#include "OGBase.h" -#include "OGComparison.h" -#include "OGTypeID.h" +#include +#include +#include OG_ASSUME_NONNULL_BEGIN diff --git a/Sources/OpenGraph_SPI/Data/ClosureFunction.hpp b/Sources/OpenGraphCxx/include/OpenGraphCxx/Data/ClosureFunction.hpp similarity index 98% rename from Sources/OpenGraph_SPI/Data/ClosureFunction.hpp rename to Sources/OpenGraphCxx/include/OpenGraphCxx/Data/ClosureFunction.hpp index de905963..78147860 100644 --- a/Sources/OpenGraph_SPI/Data/ClosureFunction.hpp +++ b/Sources/OpenGraphCxx/include/OpenGraphCxx/Data/ClosureFunction.hpp @@ -8,7 +8,7 @@ #ifndef ClosureFunction_hpp #define ClosureFunction_hpp -#include "OGBase.h" +#include #include OG_ASSUME_NONNULL_BEGIN diff --git a/Sources/OpenGraph_SPI/Data/page.hpp b/Sources/OpenGraphCxx/include/OpenGraphCxx/Data/page.hpp similarity index 77% rename from Sources/OpenGraph_SPI/Data/page.hpp rename to Sources/OpenGraphCxx/include/OpenGraphCxx/Data/page.hpp index 22c2ce41..b72b6b09 100644 --- a/Sources/OpenGraph_SPI/Data/page.hpp +++ b/Sources/OpenGraphCxx/include/OpenGraphCxx/Data/page.hpp @@ -1,12 +1,12 @@ // // page.hpp -// OpenGraph_SPI +// OpenGraphCxx #ifndef page_hpp #define page_hpp -#include "OGBase.h" -#include "ptr.hpp" +#include +#include namespace OG { namespace data { diff --git a/Sources/OpenGraph_SPI/Data/page_const.hpp b/Sources/OpenGraphCxx/include/OpenGraphCxx/Data/page_const.hpp similarity index 89% rename from Sources/OpenGraph_SPI/Data/page_const.hpp rename to Sources/OpenGraphCxx/include/OpenGraphCxx/Data/page_const.hpp index b03ea77c..ff75537b 100644 --- a/Sources/OpenGraph_SPI/Data/page_const.hpp +++ b/Sources/OpenGraphCxx/include/OpenGraphCxx/Data/page_const.hpp @@ -1,11 +1,11 @@ // // page_const.hpp -// OpenGraph_SPI +// OpenGraphCxx #ifndef page_const_hpp #define page_const_hpp -#include "OGBase.h" +#include namespace OG { namespace data { diff --git a/Sources/OpenGraph_SPI/Data/ptr.hpp b/Sources/OpenGraphCxx/include/OpenGraphCxx/Data/ptr.hpp similarity index 96% rename from Sources/OpenGraph_SPI/Data/ptr.hpp rename to Sources/OpenGraphCxx/include/OpenGraphCxx/Data/ptr.hpp index a96bd559..604fd3fd 100644 --- a/Sources/OpenGraph_SPI/Data/ptr.hpp +++ b/Sources/OpenGraphCxx/include/OpenGraphCxx/Data/ptr.hpp @@ -1,6 +1,6 @@ // // ptr.hpp -// OpenGraph_SPI +// OpenGraphCxx // // Status: Complete // Modified from https://github.com/jcmosc/Compute/blob/0a6b21a4cdeb9bbdd95e7e914c4e18bed37a2456/Sources/ComputeCxx/Data/Pointer.h [MIT License] @@ -8,10 +8,10 @@ #ifndef ptr_hpp #define ptr_hpp -#include "OGBase.h" -#include "OpenGraphCxx/table.hpp" +#include +#include #include -#include "page_const.hpp" +#include OG_ASSUME_NONNULL_BEGIN diff --git a/Sources/OpenGraph_SPI/include/OpenGraphCxx/table.hpp b/Sources/OpenGraphCxx/include/OpenGraphCxx/Data/table.hpp similarity index 97% rename from Sources/OpenGraph_SPI/include/OpenGraphCxx/table.hpp rename to Sources/OpenGraphCxx/include/OpenGraphCxx/Data/table.hpp index de51d153..1b6f8ed0 100644 --- a/Sources/OpenGraph_SPI/include/OpenGraphCxx/table.hpp +++ b/Sources/OpenGraphCxx/include/OpenGraphCxx/Data/table.hpp @@ -1,12 +1,12 @@ // // table.hpp -// OpenGraph_SPI +// OpenGraphCxx #ifndef table_hpp #define table_hpp -#include "OGBase.h" -#include "../Vector/vector.hpp" +#include +#include #if OG_TARGET_OS_DARWIN #include #else diff --git a/Sources/OpenGraph_SPI/Data/zone.hpp b/Sources/OpenGraphCxx/include/OpenGraphCxx/Data/zone.hpp similarity index 95% rename from Sources/OpenGraph_SPI/Data/zone.hpp rename to Sources/OpenGraphCxx/include/OpenGraphCxx/Data/zone.hpp index 5e5b5ca6..c2c83a3e 100644 --- a/Sources/OpenGraph_SPI/Data/zone.hpp +++ b/Sources/OpenGraphCxx/include/OpenGraphCxx/Data/zone.hpp @@ -1,12 +1,12 @@ // // zone.hpp -// OpenGraph_SPI +// OpenGraphCxx #ifndef zone_hpp #define zone_hpp -#include "OGBase.h" -#include "ptr.hpp" +#include +#include namespace OG { namespace data { diff --git a/Sources/OpenGraph_SPI/Debug/og-debug-server.hpp b/Sources/OpenGraphCxx/include/OpenGraphCxx/DebugServer/og-debug-server.hpp similarity index 93% rename from Sources/OpenGraph_SPI/Debug/og-debug-server.hpp rename to Sources/OpenGraphCxx/include/OpenGraphCxx/DebugServer/og-debug-server.hpp index f0522912..efa57d99 100644 --- a/Sources/OpenGraph_SPI/Debug/og-debug-server.hpp +++ b/Sources/OpenGraphCxx/include/OpenGraphCxx/DebugServer/og-debug-server.hpp @@ -8,10 +8,10 @@ #ifndef og_debug_server_hpp #define og_debug_server_hpp -#include "OGBase.h" +#include #if OG_TARGET_OS_DARWIN -#include "OGDebugServer.h" -#include "../Vector/vector.hpp" +#include +#include #include #include diff --git a/Sources/OpenGraph_SPI/Graph/Graph.hpp b/Sources/OpenGraphCxx/include/OpenGraphCxx/Graph/Graph.hpp similarity index 95% rename from Sources/OpenGraph_SPI/Graph/Graph.hpp rename to Sources/OpenGraphCxx/include/OpenGraphCxx/Graph/Graph.hpp index 5921b86d..4db8d92a 100644 --- a/Sources/OpenGraph_SPI/Graph/Graph.hpp +++ b/Sources/OpenGraphCxx/include/OpenGraphCxx/Graph/Graph.hpp @@ -1,16 +1,16 @@ // // Graph.hpp -// OpenGraph_SPI +// OpenGraphCxx #ifndef Graph_hpp #define Graph_hpp -#include "OGBase.h" -#include "OGGraph.h" -#include "OGUniqueID.h" -#include "../Private/CFRuntime.h" -#include "../Data/ClosureFunction.hpp" +#include +#include +#include +#include +#include OG_ASSUME_NONNULL_BEGIN diff --git a/Sources/OpenGraphCxx/include/OpenGraphCxx/Graph/Subgraph.hpp b/Sources/OpenGraphCxx/include/OpenGraphCxx/Graph/Subgraph.hpp new file mode 100644 index 00000000..c55cc08d --- /dev/null +++ b/Sources/OpenGraphCxx/include/OpenGraphCxx/Graph/Subgraph.hpp @@ -0,0 +1,112 @@ +// +// Subgraph.hpp +// +// +// Created by Kyle on 2024/2/15. +// + +#ifndef Subgraph_hpp +#define Subgraph_hpp + +#include +#include +#include +#include +#include +#include + +typedef struct OG_BRIDGED_TYPE(id) OGSubgraphStorage * OGSubgraphRef; + +namespace OG { +class SubgraphObject; + +class Subgraph final { +private: + OGSubgraphRef _cf_subgraph; + OGGraphContextStorage& _context; + // TODO + bool _isInvalid; + static pthread_key_t _current_subgraph_key; +public: + // MARK: - CF related + + static Subgraph *from_cf(OGSubgraphRef cf_subgraph) OG_NOEXCEPT; + + OGSubgraphRef to_cf() const OG_NOEXCEPT { + return _cf_subgraph; + } + + // MARK: - pthread related + + OG_INLINE + const static void make_current_subgraph_key() OG_NOEXCEPT { + pthread_key_create(&_current_subgraph_key, nullptr); + } + + OG_INLINE OG_CONSTEXPR + const static pthread_key_t& current_key() OG_NOEXCEPT { + return _current_subgraph_key; + } + + OG_INLINE OG_CONSTEXPR + static Subgraph *get_current() OG_NOEXCEPT { + return (OG::Subgraph*)pthread_getspecific(OG::Subgraph::current_key()); + } + + OG_INLINE OG_CONSTEXPR + static int set_current(Subgraph *subgraph) OG_NOEXCEPT { + return pthread_setspecific(OG::Subgraph::current_key(), subgraph); + } + + // MARK: - Public API + void clear_object() const OG_NOEXCEPT; + void invalidate_and_delete_(bool) const OG_NOEXCEPT; + + void apply(OGAttributeFlags flags, OG::ClosureFunction body) const OG_NOEXCEPT; + + OGUniqueID add_observer(OG::ClosureFunction observer) const OG_NOEXCEPT; + + void begin_tree(OG::AttributeID id, OG::swift::metadata const *type, uint32_t flags) const OG_NOEXCEPT; + void add_tree_value(OG::AttributeID id, OG::swift::metadata const *type, const char* key, uint32_t flags) const OG_NOEXCEPT; + void end_tree(OG::AttributeID id) const OG_NOEXCEPT; + + // MARK: - Init and deinit + + Subgraph(SubgraphObject*, OG::Graph::Context&, OG::AttributeID); + + // MARK: - Getter and setter + + OG_INLINE OG_CONSTEXPR + const OGGraphContextRef get_context() const OG_NOEXCEPT { + return &_context; + } + + OG_INLINE OG_CONSTEXPR + OGGraphContextRef get_context() OG_NOEXCEPT { + return &_context; + } + + OG_INLINE OG_CONSTEXPR + const bool isInvalid() const OG_NOEXCEPT { + return _isInvalid; + } + + OG_INLINE OG_CONSTEXPR + void setInvalid(bool invalid) OG_NOEXCEPT { + _isInvalid = invalid; + } +}; /* Subgraph */ +} /* OG */ + +struct OGSubgraphStorage { + CFRuntimeBase base; + OG::Subgraph *subgraph; +}; + +namespace OG { +class SubgraphObject final { + OGSubgraphStorage storage; +}; +} + +#endif /* Subgraph_hpp */ diff --git a/Sources/OpenGraph_SPI/Runtime/metadata.hpp b/Sources/OpenGraphCxx/include/OpenGraphCxx/Runtime/metadata.hpp similarity index 98% rename from Sources/OpenGraph_SPI/Runtime/metadata.hpp rename to Sources/OpenGraphCxx/include/OpenGraphCxx/Runtime/metadata.hpp index 4bdc860f..b27912a8 100644 --- a/Sources/OpenGraph_SPI/Runtime/metadata.hpp +++ b/Sources/OpenGraphCxx/include/OpenGraphCxx/Runtime/metadata.hpp @@ -1,6 +1,6 @@ // // metadata.hpp -// OpenGraph_SPI +// OpenGraphCxx // // Audited for iOS 18.0 // Status: WIP @@ -8,7 +8,7 @@ #ifndef metadata_hpp #define metadata_hpp -#include "OGBase.h" +#include #ifdef OPENGRAPH_SWIFT_TOOLCHAIN_SUPPORTED #include diff --git a/Sources/OpenGraph_SPI/Util/assert.hpp b/Sources/OpenGraphCxx/include/OpenGraphCxx/Util/assert.hpp similarity index 83% rename from Sources/OpenGraph_SPI/Util/assert.hpp rename to Sources/OpenGraphCxx/include/OpenGraphCxx/Util/assert.hpp index 525187b8..683c9c7f 100644 --- a/Sources/OpenGraph_SPI/Util/assert.hpp +++ b/Sources/OpenGraphCxx/include/OpenGraphCxx/Util/assert.hpp @@ -1,11 +1,11 @@ // // assert.hpp -// OpenGraph_SPI +// OpenGraphCxx #ifndef assert_hpp #define assert_hpp -#include "OGBase.h" +#include namespace OG { void precondition_failure(const char *format, ...) __cold __dead2; diff --git a/Sources/OpenGraph_SPI/Util/env.hpp b/Sources/OpenGraphCxx/include/OpenGraphCxx/Util/env.hpp similarity index 90% rename from Sources/OpenGraph_SPI/Util/env.hpp rename to Sources/OpenGraphCxx/include/OpenGraphCxx/Util/env.hpp index c7eb5dab..ae562f38 100644 --- a/Sources/OpenGraph_SPI/Util/env.hpp +++ b/Sources/OpenGraphCxx/include/OpenGraphCxx/Util/env.hpp @@ -8,7 +8,7 @@ #ifndef env_hpp #define env_hpp -#include "OGBase.h" +#include namespace OG { OG_INLINE diff --git a/Sources/OpenGraph_SPI/Util/log.hpp b/Sources/OpenGraphCxx/include/OpenGraphCxx/Util/log.hpp similarity index 90% rename from Sources/OpenGraph_SPI/Util/log.hpp rename to Sources/OpenGraphCxx/include/OpenGraphCxx/Util/log.hpp index e661d669..ef2bc5c6 100644 --- a/Sources/OpenGraph_SPI/Util/log.hpp +++ b/Sources/OpenGraphCxx/include/OpenGraphCxx/Util/log.hpp @@ -8,7 +8,7 @@ #ifndef log_hpp #define log_hpp -#include "OGBase.h" +#include #if OG_TARGET_OS_DARWIN diff --git a/Sources/OpenGraph_SPI/Util/realloc_vector.hpp b/Sources/OpenGraphCxx/include/OpenGraphCxx/Util/realloc_vector.hpp similarity index 94% rename from Sources/OpenGraph_SPI/Util/realloc_vector.hpp rename to Sources/OpenGraphCxx/include/OpenGraphCxx/Util/realloc_vector.hpp index 558067bf..ec1c006a 100644 --- a/Sources/OpenGraph_SPI/Util/realloc_vector.hpp +++ b/Sources/OpenGraphCxx/include/OpenGraphCxx/Util/realloc_vector.hpp @@ -8,7 +8,7 @@ #ifndef realloc_vector_hpp #define realloc_vector_hpp -#include "OGBase.h" +#include OG_ASSUME_NONNULL_BEGIN diff --git a/Sources/OpenGraph_SPI/Vector/vector.hpp b/Sources/OpenGraphCxx/include/OpenGraphCxx/Vector/vector.hpp similarity index 99% rename from Sources/OpenGraph_SPI/Vector/vector.hpp rename to Sources/OpenGraphCxx/include/OpenGraphCxx/Vector/vector.hpp index 161c6968..f785ac02 100644 --- a/Sources/OpenGraph_SPI/Vector/vector.hpp +++ b/Sources/OpenGraphCxx/include/OpenGraphCxx/Vector/vector.hpp @@ -1,6 +1,6 @@ // // vector.hpp -// OpenGraph_SPI +// OpenGraphCxx // // Status: Complete // Modified from https://github.com/jcmosc/Compute/blob/00dfebc2c5852144ac5aada8ebe896b78e5f622a/Sources/ComputeCxx/Vector/Vector.h [MIT License] @@ -8,7 +8,7 @@ #ifndef vector_hpp #define vector_hpp -#include "OGBase.h" +#include #include #include #include diff --git a/Sources/OpenGraph_SPI/Vector/vector.tpp b/Sources/OpenGraphCxx/include/OpenGraphCxx/Vector/vector.tpp similarity index 98% rename from Sources/OpenGraph_SPI/Vector/vector.tpp rename to Sources/OpenGraphCxx/include/OpenGraphCxx/Vector/vector.tpp index f11be1e3..4e4598fa 100644 --- a/Sources/OpenGraph_SPI/Vector/vector.tpp +++ b/Sources/OpenGraphCxx/include/OpenGraphCxx/Vector/vector.tpp @@ -1,12 +1,12 @@ // // vector.hpp -// OpenGraph_SPI +// OpenGraphCxx // // Status: Complete // Modified from https://github.com/jcmosc/Compute/blob/00dfebc2c5852144ac5aada8ebe896b78e5f622a/Sources/ComputeCxx/Vector/Vector.tpp [MIT Lisence] -#include "vector.hpp" -#include "../Util/assert.hpp" +#include +#include #include #if OG_TARGET_OS_DARWIN diff --git a/Sources/OpenGraphCxx/include/module.modulemap b/Sources/OpenGraphCxx/include/module.modulemap new file mode 100644 index 00000000..da511625 --- /dev/null +++ b/Sources/OpenGraphCxx/include/module.modulemap @@ -0,0 +1,8 @@ +module OpenGraphCxx { + export * +} + +module OpenGraphCxx.C { + umbrella header "OpenGraphC/OpenGraph-umbrella.h" + export * +} diff --git a/Sources/OpenGraphCxx/include/module.private.modulemap b/Sources/OpenGraphCxx/include/module.private.modulemap new file mode 100644 index 00000000..006b447a --- /dev/null +++ b/Sources/OpenGraphCxx/include/module.private.modulemap @@ -0,0 +1,21 @@ +module OpenGraphCxx_Private { + export * +} + +module OpenGraphCxx_Private.Attribute { + requires cplusplus + umbrella "OpenGraphCxx/Attribute" + export * +} + +module OpenGraphCxx_Private.Data { + requires cplusplus + umbrella "OpenGraphCxx/Data" + export * +} + +module OpenGraphCxx_Private.Comparison { + requires cplusplus + umbrella "OpenGraphCxx/Comparison" + export * +} diff --git a/Sources/OpenGraph_SPI/Attribute/AttributeID.cpp b/Sources/OpenGraph_SPI/Attribute/AttributeID.cpp deleted file mode 100644 index 10f09a85..00000000 --- a/Sources/OpenGraph_SPI/Attribute/AttributeID.cpp +++ /dev/null @@ -1,8 +0,0 @@ -// -// AttributeID.cpp -// -// -// Created by Kyle on 2024/2/16. -// - -#include "AttributeID.hpp" diff --git a/Sources/OpenGraph_SPI/include/OpenGraph-umbrella.h b/Sources/OpenGraph_SPI/include/OpenGraph-umbrella.h deleted file mode 100644 index 046aabc1..00000000 --- a/Sources/OpenGraph_SPI/include/OpenGraph-umbrella.h +++ /dev/null @@ -1,29 +0,0 @@ -#include "OGAttribute.h" -#include "OGAttributeFlags.h" -#include "OGAttributeInfo.h" -#include "OGAttributeType.h" -#include "OGAttributeTypeFlags.h" -#include "OGBase.h" -#include "OGCachedValueOptions.h" -#include "OGChangedValueFlags.h" -#include "OGComparison.h" -#include "OGCounterQueryType.h" -#include "OGDebugServer.h" -#include "OGGraph.h" -#include "OGGraphContext.h" -#include "OGGraphDescription.h" -#include "OGGraphTracing.h" -#include "OGInputOptions.h" -#include "OGSearchOptions.h" -#include "OGSubgraph.h" -#include "OGTupleType.h" -#include "OGTypeID.h" -#include "OGUniqueID.h" -#include "OGValue.h" -#include "OGValueOptions.h" -#include "OGValueState.h" -#include "OGVersion.h" -#include "OGWeakAttribute.h" - -OG_EXPORT double OpenGraphVersionNumber; -OG_EXPORT const unsigned char OpenGraphVersionString[]; diff --git a/Sources/OpenGraph_SPI/include/module.modulemap b/Sources/OpenGraph_SPI/include/module.modulemap deleted file mode 100644 index c97b982d..00000000 --- a/Sources/OpenGraph_SPI/include/module.modulemap +++ /dev/null @@ -1,11 +0,0 @@ -module OpenGraph_SPI { - header "OpenGraph-umbrella.h" - export * -} - -// TODO: Change to module OpenGraphCxx and OpenGraphCxx.Internal -module OpenGraph_SPI.Cxx { - requires cplusplus - umbrella "OpenGraphCxx" - export * -} diff --git a/Tests/OpenGraph_SPITests/OpenGraph_SPITests.swift b/Tests/OpenGraphCxxTests/OpenGraphCxxTests.swift similarity index 62% rename from Tests/OpenGraph_SPITests/OpenGraph_SPITests.swift rename to Tests/OpenGraphCxxTests/OpenGraphCxxTests.swift index 218cc8f3..91837d7f 100644 --- a/Tests/OpenGraph_SPITests/OpenGraph_SPITests.swift +++ b/Tests/OpenGraphCxxTests/OpenGraphCxxTests.swift @@ -1,11 +1,11 @@ // -// OpenGraph_SPITests.swift -// OpenGraph +// OpenGraphCxxTests.swift +// OpenGraphCxxTests -import OpenGraph_SPI.Cxx +import OpenGraphCxx_Private import Testing -struct OpenGraph_SPITests { +struct OpenGraphCxxTests { #if canImport(Darwin) // table() is not implemented on Linux yet. @Test func table() { diff --git a/Tests/OpenGraphCxxTests/README.md b/Tests/OpenGraphCxxTests/README.md new file mode 100644 index 00000000..ca665656 --- /dev/null +++ b/Tests/OpenGraphCxxTests/README.md @@ -0,0 +1,3 @@ +## OpenGraphCxxTests + +Test internal C++ API of OpenGraphCxx diff --git a/Tests/OpenGraph_SPITests/README.md b/Tests/OpenGraph_SPITests/README.md deleted file mode 100644 index 4230328b..00000000 --- a/Tests/OpenGraph_SPITests/README.md +++ /dev/null @@ -1,3 +0,0 @@ -## OpenGraph_SPITests - -Test C++ API of OpenGraph_SPI