Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mockingbirdnest/Principia
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 3dd6ffc31f90
Choose a base ref
...
head repository: mockingbirdnest/Principia
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: d7403a9410dc
Choose a head ref
  • 8 commits
  • 4 files changed
  • 1 contributor

Commits on Nov 1, 2020

  1. Generated files pre-change.

    pleroy committed Nov 1, 2020
    Copy the full SHA
    0f06b12 View commit details

Commits on Nov 4, 2020

  1. Support for saying not found.

    pleroy committed Nov 4, 2020
    Copy the full SHA
    42955a4 View commit details

Commits on Nov 7, 2020

  1. Trying with (address_of).

    pleroy committed Nov 7, 2020
    Copy the full SHA
    bc232ed View commit details
  2. Copy the full SHA
    bd071a5 View commit details
  3. A separate pass for the (address_of) fields and support for pointer m…

    …apping in interchange messages.
    pleroy committed Nov 7, 2020
    Copy the full SHA
    29e1155 View commit details
  4. Generated files post-change.

    pleroy committed Nov 7, 2020
    Copy the full SHA
    747e1b6 View commit details
  5. Remove the generated files.

    pleroy committed Nov 7, 2020
    Copy the full SHA
    844f1fd View commit details
  6. Merge pull request #2782 from pleroy/2778b

    Proper journaling of messages returned from functions
    pleroy authored Nov 7, 2020
    Copy the full SHA
    d7403a9 View commit details
Showing with 226 additions and 39 deletions.
  1. +7 −0 ksp_plugin/interface.cpp
  2. +37 −6 serialization/journal.proto
  3. +169 −31 tools/journal_proto_processor.cpp
  4. +13 −2 tools/journal_proto_processor.hpp
7 changes: 7 additions & 0 deletions ksp_plugin/interface.cpp
Original file line number Diff line number Diff line change
@@ -1036,6 +1036,13 @@ char const* __cdecl principia__SayHello() {
return m.Return("Hello from native C++!");
}

// For checking that interchange messages work.
Status* __cdecl principia__SayNotFound() {
journal::Method<journal::SayNotFound> m;
return m.Return(ToNewStatus(
base::Status(base::Error::NOT_FOUND, "Not found from native C++!")));
}

// |plugin| must not be null. The caller takes ownership of the result, except
// when it is null (at the end of the stream). No transfer of ownership of
// |*plugin|. |*serializer| must be null on the first call and must be passed
43 changes: 37 additions & 6 deletions serialization/journal.proto
Original file line number Diff line number Diff line change
@@ -212,10 +212,13 @@ message OrbitAnalysis {
optional OrbitalElements elements = 4 [(is_produced) = true];
optional OrbitRecurrence recurrence = 5 [(is_produced) = true];
optional OrbitGroundTrack ground_track = 6 [(is_produced) = true];
required fixed64 elements_address = 7 [(address_of) = "elements"];
required fixed64 recurrence_address = 8 [(address_of) = "recurrence"];
required fixed64 ground_track_address = 9 [(address_of) = "ground_track"];
}

message Method {
extensions 5000 to 5999; // Last used: 5174.
extensions 5000 to 5999; // Last used: 5175.
}

message AdvanceTime {
@@ -527,6 +530,7 @@ message ExternalCelestialGetPosition {
}
message Return {
required Status result = 1 [(is_produced) = true];
required fixed64 address = 2 [(address_of) = "result"];
}
optional In in = 1;
optional Out out = 2;
@@ -551,6 +555,7 @@ message ExternalCelestialGetSurfacePosition {
}
message Return {
required Status result = 1 [(is_produced) = true];
required fixed64 address = 2 [(address_of) = "result"];
}
optional In in = 1;
optional Out out = 2;
@@ -578,6 +583,7 @@ message ExternalFlowFreefall {
}
message Return {
required Status result = 1 [(is_produced) = true];
required fixed64 address = 2 [(address_of) = "result"];
}
optional In in = 1;
optional Out out = 2;
@@ -603,6 +609,7 @@ message ExternalGeopotentialGetCoefficient {
}
message Return {
required Status result = 1 [(is_produced) = true];
required fixed64 address = 2 [(address_of) = "result"];
}
optional In in = 1;
optional Out out = 2;
@@ -627,6 +634,7 @@ message ExternalGeopotentialGetReferenceRadius {
}
message Return {
required Status result = 1 [(is_produced) = true];
required fixed64 address = 2 [(address_of) = "result"];
}
optional In in = 1;
optional Out out = 2;
@@ -648,6 +656,7 @@ message ExternalVesselGetPosition {
}
message Return {
required Status result = 1 [(is_produced) = true];
required fixed64 address = 2 [(address_of) = "result"];
}
optional In in = 1;
optional Out out = 2;
@@ -674,6 +683,7 @@ message ExternalGetNearestPlannedCoastDegreesOfFreedom {
}
message Return {
required Status result = 1 [(is_produced) = true];
required fixed64 address = 2 [(address_of) = "result"];
}
optional In in = 1;
optional Out out = 2;
@@ -852,6 +862,7 @@ message FlightPlanInsert {
}
message Return {
required Status result = 1 [(is_produced) = true];
required fixed64 address = 2 [(address_of) = "result"];
}
optional In in = 1;
optional Return return = 3;
@@ -917,7 +928,8 @@ message FlightPlanRebase {
required double mass_in_tonnes = 3;
}
message Return {
required Status result = 1;
required Status result = 1 [(is_produced) = true];
required fixed64 address = 2 [(address_of) = "result"];
}
optional In in = 1;
optional Return return = 3;
@@ -935,6 +947,7 @@ message FlightPlanRemove {
}
message Return {
required Status result = 1 [(is_produced) = true];
required fixed64 address = 2 [(address_of) = "result"];
}
optional In in = 1;
optional Return return = 3;
@@ -1041,6 +1054,7 @@ message FlightPlanReplace {
}
message Return {
required Status result = 1 [(is_produced) = true];
required fixed64 address = 2 [(address_of) = "result"];
}
optional In in = 1;
optional Return return = 3;
@@ -1059,6 +1073,7 @@ message FlightPlanSetAdaptiveStepParameters {
}
message Return {
required Status result = 1 [(is_produced) = true];
required fixed64 address = 2 [(address_of) = "result"];
}
optional In in = 1;
optional Return return = 3;
@@ -1076,6 +1091,7 @@ message FlightPlanSetDesiredFinalTime {
}
message Return {
required Status result = 1 [(is_produced) = true];
required fixed64 address = 2 [(address_of) = "result"];
}
optional In in = 1;
optional Return return = 3;
@@ -1984,6 +2000,17 @@ message SayHello {
optional Return return = 3;
}

message SayNotFound {
extend Method {
optional SayNotFound extension = 5175;
}
message Return {
required Status result = 1 [(is_produced) = true];
required fixed64 address = 2 [(address_of) = "result"];
}
optional Return return = 3;
}

message SerializePlugin {
extend Method {
optional SerializePlugin extension = 5054;
@@ -2240,6 +2267,7 @@ message VesselRefreshAnalysis {
}
message Return {
required OrbitAnalysis result = 1 [(is_produced) = true];
required fixed64 address = 2 [(address_of) = "result"];
}
optional In in = 1;
optional Return return = 3;
@@ -2306,10 +2334,6 @@ extend google.protobuf.FieldOptions {
optional string is_consumed_if = 50004;
optional string is_produced_if = 50005;

// For a fixed64 field that is not consumed, indicates that it should follow
// the Dispose pattern and gives the name of the disposable class.
optional string disposable = 50009;

// For a fixed64 field (which is used to represent a pointer), indicates that
// it should be the subject in C# methods.
optional bool is_subject = 50006;
@@ -2322,6 +2346,13 @@ extend google.protobuf.FieldOptions {
// For a fixed64 field that is produced and denotes a string, indicates the
// encoding and the representation.
optional Encoding encoding = 50008;

// For a fixed64 field that is not consumed, indicates that it should follow
// the Dispose pattern and gives the name of the disposable class.
optional string disposable = 50009;

//TODO(phl):comment
optional string address_of = 50010;
}

extend google.protobuf.MessageOptions {
Loading