MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / ScopedAsset

Class ScopedAsset

tensorflow/contrib/android/asset_manager_filesystem.cc:35–48  ·  view source on GitHub ↗

Closes the given AAsset when variable is destructed.

Source from the content-addressed store, hash-verified

33
34// Closes the given AAsset when variable is destructed.
35class ScopedAsset {
36 public:
37 ScopedAsset(AAsset* asset) : asset_(asset) {}
38 ~ScopedAsset() {
39 if (asset_ != nullptr) {
40 AAsset_close(asset_);
41 }
42 }
43
44 AAsset* get() const { return asset_; }
45
46 private:
47 AAsset* asset_;
48};
49
50// Closes the given AAssetDir when variable is destructed.
51class ScopedAssetDir {

Callers 5

ReadMethod · 0.85
FileExistsMethod · 0.85
NewRandomAccessFileMethod · 0.85
GetFileSizeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected