-
-
Notifications
You must be signed in to change notification settings - Fork 459
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,15 @@ | ||
using System; | ||
|
||
using pb = global::Google.Protobuf; | ||
namespace Mediapipe { | ||
public class CalculatorGraphConfig : MpResourceHandle { | ||
public CalculatorGraphConfig(IntPtr ptr) : base(ptr) {} | ||
|
||
public static CalculatorGraphConfig ParseFromString(string configText) { | ||
return Protobuf.ParseFromStringAsCalculatorGraphConfig(configText); | ||
} | ||
|
||
protected override void DeleteMpPtr() { | ||
UnsafeNativeMethods.mp_CalculatorGraphConfig__delete(ptr); | ||
} | ||
public static class CalculatorGraphConfigExtension { | ||
/// <summary> | ||
/// </summary> | ||
public static CalculatorGraphConfig ParseFromTextFormat(this pb::MessageParser<CalculatorGraphConfig> parser, string configText) { | ||
UnsafeNativeMethods.mp_api__ConvertFromCalculatorGraphConfigTextFormat(configText, out var serializedProtoPtr).Assert(); | ||
|
||
public int byteSizeLong { | ||
get { return UnsafeNativeMethods.mp_CalculatorGraphConfig__ByteSizeLong(mpPtr); } | ||
} | ||
|
||
/// <exception cref="InvalidOperationException">Thrown when some required fields are not set</exception> | ||
public string SerializeAsString() { | ||
var str = MarshalStringFromNative(UnsafeNativeMethods.mp_CalculatorGraphConfig__SerializeAsString); | ||
|
||
if (str == null) { | ||
throw new InvalidOperationException("All the required fields must be set"); | ||
} | ||
|
||
return str; | ||
} | ||
var config = Protobuf.DeserializeProto(serializedProtoPtr, CalculatorGraphConfig.Parser); | ||
UnsafeNativeMethods.mp_api_SerializedProto__delete(serializedProtoPtr); | ||
|
||
public string DebugString() { | ||
return MarshalStringFromNative(UnsafeNativeMethods.mp_CalculatorGraphConfig__DebugString); | ||
return config; | ||
} | ||
} | ||
} |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using System; | ||
using System.Runtime.InteropServices; | ||
|
||
namespace Mediapipe { | ||
internal static partial class UnsafeNativeMethods { | ||
[DllImport (MediaPipeLibrary, ExactSpelling = true)] | ||
public static extern MpReturnCode mp_api__ConvertFromCalculatorGraphConfigTextFormat(string configText, out IntPtr serializedProto); | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
This file was deleted.