Skip to content

Commit

Permalink
Avoid string_view
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Nett <[email protected]>
  • Loading branch information
rnett committed Jun 27, 2021
1 parent fbe696a commit 8f8aadc
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,10 @@ public class TFLogEntry extends Pointer {
/** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
public TFLogEntry(Pointer p) { super(p); }

public TFLogEntry(int severity, @StdString @Cast({"char*", "std::string&&"}) BytePointer message) { super((Pointer)null); allocate(severity, message); }
private native void allocate(int severity, @StdString @Cast({"char*", "std::string&&"}) BytePointer message);
public TFLogEntry(int severity, @StdString @Cast({"char*", "std::string&&"}) String message) { super((Pointer)null); allocate(severity, message); }
private native void allocate(int severity, @StdString @Cast({"char*", "std::string&&"}) String message);

public TFLogEntry(int severity, @StdString @Cast({"char*", "std::string&&"}) BytePointer fname, int line,
@StdString @Cast({"char*", "std::string&&"}) BytePointer message) { super((Pointer)null); allocate(severity, fname, line, message); }
private native void allocate(int severity, @StdString @Cast({"char*", "std::string&&"}) BytePointer fname, int line,
@StdString @Cast({"char*", "std::string&&"}) BytePointer message);
public TFLogEntry(int severity, @StdString @Cast({"char*", "std::string&&"}) String fname, int line,
@StdString @Cast({"char*", "std::string&&"}) String message) { super((Pointer)null); allocate(severity, fname, line, message); }
private native void allocate(int severity, @StdString @Cast({"char*", "std::string&&"}) String fname, int line,
@StdString @Cast({"char*", "std::string&&"}) String message);

public native @Cast("absl::LogSeverity") int log_severity();
public native @StdString @Cast({"char*", "std::string&&"}) BytePointer FName();
public native int Line();
public native @StdString @Cast({"char*", "std::string&&"}) BytePointer ToString();
public native @StdString @Cast({"char*", "std::string&&"}) BytePointer text_message();
public native @StdString @Cast({"", "", "std::string"}) BytePointer text_message();
}
Original file line number Diff line number Diff line change
Expand Up @@ -403,33 +403,43 @@ public void map(InfoMap infoMap) {
.cast()
.valueTypes("long")
.pointerTypes("LongPointer", "long[]"))
.put(new Info("absl::string_view", "absl::lts_2020_09_23::string_view", "string", "std::string", "tensorflow::string").annotations("@StdString")
.put(new Info("string", "std::string", "tensorflow::string").annotations("@StdString")
.valueTypes("@Cast({\"char*\", \"std::string&&\"}) BytePointer", "@Cast({\"char*\", \"std::string&&\"}) String")
.pointerTypes("@Cast({\"char*\", \"std::string*\"}) BytePointer"))
.put(new Info("absl::LogSeverity", "LogSeverity", "tensorflow::LogSeverity").cast().valueTypes("int").pointerTypes("IntPointer", "int[]"))
.put(new Info("tensorflow::internal::LogEveryNSecState",
"tensorflow::internal::LogEveryNState",
"tensorflow::internal::LogEveryPow2State",
"tensorflow::internal::LogFirstNState",
"tensorflow::internal::Voidifier",
"tensorflow::internal::LogMessage",
"tensorflow::internal::LogMessageFatal",
"tensorflow::internal::LogMessageNull",
"tensorflow::internal::CheckOpMessageBuilder",
"tensorflow::internal::CheckOpString",
"tensorflow::internal::GetReferenceableValue",
"DVLOG",
"absl::LogSeverities").skip())
.put(new Info(
"tensorflow::INFO",
"tensorflow::WARNING",
"tensorflow::ERROR",
"tensorflow::FATAL",
"tensorflow::NUM_SEVERITIES",
"_TF_LOG_INFO",
"_TF_LOG_WARNING",
"_TF_LOG_ERROR",
"_TF_LOG_FATAL",
"_TF_LOG_QFATAL").skip());
.put(
new Info("absl::LogSeverity", "LogSeverity", "tensorflow::LogSeverity")
.cast()
.valueTypes("int")
.pointerTypes("IntPointer", "int[]"))
.put(new Info("tensorflow::TFLogEntry").purify())
.put(
new Info(
"tensorflow::internal::LogEveryNSecState",
"tensorflow::internal::LogEveryNState",
"tensorflow::internal::LogEveryPow2State",
"tensorflow::internal::LogFirstNState",
"tensorflow::internal::Voidifier",
"tensorflow::internal::LogMessage",
"tensorflow::internal::LogMessageFatal",
"tensorflow::internal::LogMessageNull",
"tensorflow::internal::CheckOpMessageBuilder",
"tensorflow::internal::CheckOpString",
"tensorflow::internal::GetReferenceableValue",
"DVLOG",
"absl::LogSeverities")
.skip())
.put(
new Info(
"tensorflow::INFO",
"tensorflow::WARNING",
"tensorflow::ERROR",
"tensorflow::FATAL",
"tensorflow::NUM_SEVERITIES",
"_TF_LOG_INFO",
"_TF_LOG_WARNING",
"_TF_LOG_ERROR",
"_TF_LOG_FATAL",
"_TF_LOG_QFATAL")
.skip());
}
}

0 comments on commit 8f8aadc

Please sign in to comment.