Skip to content

Commit

Permalink
[io] add async IO feature flag to RRawFile
Browse files Browse the repository at this point in the history
  • Loading branch information
mxxo authored and jblomer committed Jul 3, 2020
1 parent fca6716 commit 2d799d2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions io/io/inc/ROOT/RRawFile.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ public:
static constexpr int kFeatureHasSize = 0x01;
/// Map() and Unmap() are implemented
static constexpr int kFeatureHasMmap = 0x02;
/// File supports async IO
static constexpr int kFeatureHasAsyncIo = 0x04;

/// On construction, an ROptions parameter can customize the RRawFile behavior
struct ROptions {
Expand Down
2 changes: 1 addition & 1 deletion io/io/inc/ROOT/RRawFileUnix.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public:
RRawFileUnix(std::string_view url, RRawFile::ROptions options);
~RRawFileUnix();
std::unique_ptr<RRawFile> Clone() const final;
int GetFeatures() const final { return kFeatureHasSize | kFeatureHasMmap; }
int GetFeatures() const final;
};

} // namespace Internal
Expand Down
4 changes: 4 additions & 0 deletions io/io/src/RRawFileUnix.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ std::unique_ptr<ROOT::Internal::RRawFile> ROOT::Internal::RRawFileUnix::Clone()
return std::make_unique<RRawFileUnix>(fUrl, fOptions);
}

int ROOT::Internal::RRawFileUnix::GetFeatures() const {
return kFeatureHasSize | kFeatureHasMmap;
}

std::uint64_t ROOT::Internal::RRawFileUnix::GetSizeImpl()
{
struct stat info;
Expand Down

0 comments on commit 2d799d2

Please sign in to comment.