19#include "absl/status/status.h"
20#include "absl/status/statusor.h"
22#include "ortools/math_opt/model.pb.h"
29 const std::shared_ptr<ModelStorage> storage = storage_.lock();
33 if (storage !=
nullptr) {
34 storage->DeleteUpdateTracker(update_tracker_);
39 : storage_(ABSL_DIE_IF_NULL(storage)),
40 update_tracker_(storage->NewUpdateTracker()) {}
42absl::StatusOr<std::optional<ModelUpdateProto>>
44 const std::shared_ptr<ModelStorage> storage = storage_.lock();
45 if (storage ==
nullptr) {
48 return storage->ExportModelUpdate(update_tracker_, remove_names);
52 const std::shared_ptr<ModelStorage> storage = storage_.lock();
53 if (storage ==
nullptr) {
56 storage->AdvanceCheckpoint(update_tracker_);
57 return absl::OkStatus();
61 const bool remove_names)
const {
62 const std::shared_ptr<ModelStorage> storage = storage_.lock();
63 if (storage ==
nullptr) {
66 return storage->ExportModel(remove_names);
absl::StatusOr< ModelProto > ExportModel(bool remove_names=false) const
UpdateTracker(const std::shared_ptr< ModelStorage > &storage)
absl::Status AdvanceCheckpoint()
absl::StatusOr< std::optional< ModelUpdateProto > > ExportModelUpdate(bool remove_names=false)
constexpr absl::string_view kModelIsDestroyed
In SWIG mode, we don't want anything besides these top-level includes.