Medial Code Documentation
Loading...
Searching...
No Matches
Public Types | Public Member Functions
xgboost::common::ResourceHandler Class Referenceabstract

Handler for one-shot resource. More...

#include <io.h>

Inheritance diagram for xgboost::common::ResourceHandler:
xgboost::common::MallocResource xgboost::common::MmapResource

Public Types

enum  Kind : std::uint8_t { kMalloc = 0 , kMmap = 1 }
 

Public Member Functions

virtual void * Data ()=0
 
template<typename T >
T * DataAs ()
 
virtual std::size_t Size () const =0
 
auto Type () const
 
 ResourceHandler (Kind kind)
 
 ResourceHandler (ResourceHandler const &that)=delete
 
ResourceHandleroperator= (ResourceHandler const &that)=delete
 
 ResourceHandler (ResourceHandler &&that)=delete
 
ResourceHandleroperator= (ResourceHandler &&that)=delete
 
bool IsSameType (ResourceHandler const &that) const
 Wether two resources have the same type.
 

Detailed Description

Handler for one-shot resource.

Unlike std::pmr::*, the resource handler is fixed once it's constructed. Users cannot use mutable operations like resize without acquiring the specific resource first.

Member Function Documentation

◆ IsSameType()

bool xgboost::common::ResourceHandler::IsSameType ( ResourceHandler const &  that) const
inline

Wether two resources have the same type.

(both malloc or both mmap).


The documentation for this class was generated from the following files: