![]() |
Google OR-Tools v9.14
a fast and portable software suite for combinatorial optimization
|
Represents an item that contains a bunch of items that live in the same model storage. The container is considered to be associated to a given model iff it has at least one item. Derived classes should maintain this invariant. In particular, they should call SetOrCheckStorage when an item is added and they should clear the storage when becoming empty (this includes being moved from if that clears the items in the container, see comments on the move constructor).
Definition at line 157 of file model_storage_item.h.
#include <model_storage_item.h>
Public Member Functions | |
NullableModelStorageCPtr | storage () const |
Protected Member Functions | |
ModelStorageItemContainer (const NullableModelStorageCPtr storage=nullptr) | |
ModelStorageItemContainer (const ModelStorageItemContainer &other)=default | |
ModelStorageItemContainer & | operator= (const ModelStorageItemContainer &other)=default |
ModelStorageItemContainer (ModelStorageItemContainer &&other) | |
ModelStorageItemContainer & | operator= (ModelStorageItemContainer &&other) |
void | SetOrCheckStorage (const ModelStorageItem &item) |
void | SetOrCheckStorage (const ModelStorageItemContainer &container) |
|
inlineexplicitprotected |
Definition at line 165 of file model_storage_item.h.
|
protecteddefault |
Disallow slicing (https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rc-copy-virtual):
|
inlineprotected |
When moving we're leaving the moved-from object unassociated with any model. Derived classes should hold no items after being moved from.
Definition at line 177 of file model_storage_item.h.
|
protecteddefault |
|
inlineprotected |
Definition at line 179 of file model_storage_item.h.
|
inlineprotected |
Sets the storage_ to the input value if nullptr, else CHECKs that item is associated with the same storage.
Definition at line 186 of file model_storage_item.h.
|
inlineprotected |
Same as above, but additionally checks that the input container is already associated with a storage.
Definition at line 192 of file model_storage_item.h.
|
inline |
Returns nullptr if the container is not associated with any model (SetOrCheckStorage has never been called, or the container was emptied/moved from).
Definition at line 162 of file model_storage_item.h.