Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Avoid string_view
Signed-off-by: Ryan Nett <rnett@calpoly.edu>
  • Loading branch information
rnett committed Jun 27, 2021
commit 8f8aadc04d240dcc41def69e134ddd8020a769f4
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());
}
}