gem5  v20.1.0.0
Public Member Functions | Private Attributes | List of all members
FileFDEntry Class Reference

Holds file descriptors for host-backed files; host-backed files are files which were opened on the physical machine where the simulation is running (probably the thing on/under your desk). More...

#include <fd_entry.hh>

Inheritance diagram for FileFDEntry:
HBFDEntry FDEntry Serializable

Public Member Functions

 FileFDEntry (int sim_fd, int flags, std::string const &file_name, uint64_t file_offset, bool close_on_exec=false)
 
 FileFDEntry (FileFDEntry const &reg, bool close_on_exec=false)
 
std::shared_ptr< FDEntryclone () const override
 
std::string const & getFileName () const
 
uint64_t getFileOffset () const
 
void setFileName (std::string const &file_name)
 
void setFileOffset (uint64_t f_off)
 
void serialize (CheckpointOut &cp) const override
 Serialize an object. More...
 
void unserialize (CheckpointIn &cp) override
 Unserialize an object. More...
 
- Public Member Functions inherited from HBFDEntry
 HBFDEntry (int flags, int sim_fd, bool close_on_exec=false)
 
 HBFDEntry (HBFDEntry const &reg, bool close_on_exec=false)
 
int getFlags () const
 
int getSimFD () const
 
void setFlags (int flags)
 
void setSimFD (int sim_fd)
 
- Public Member Functions inherited from FDEntry
 FDEntry (bool close_on_exec=false)
 
bool getCOE () const
 
void setCOE (bool close_on_exec)
 
- Public Member Functions inherited from Serializable
 Serializable ()
 
virtual ~Serializable ()
 
void serializeSection (CheckpointOut &cp, const char *name) const
 Serialize an object into a new section. More...
 
void serializeSection (CheckpointOut &cp, const std::string &name) const
 
void unserializeSection (CheckpointIn &cp, const char *name)
 Unserialize an a child object. More...
 
void unserializeSection (CheckpointIn &cp, const std::string &name)
 

Private Attributes

std::string _fileName
 
uint64_t _fileOffset
 

Additional Inherited Members

- Static Public Member Functions inherited from Serializable
static const std::string & currentSection ()
 Gets the fully-qualified name of the active section. More...
 
static void serializeAll (const std::string &cpt_dir)
 Serializes all the SimObjects. More...
 
static void unserializeGlobals (CheckpointIn &cp)
 
- Protected Attributes inherited from HBFDEntry
int _flags
 
int _simFD
 
- Protected Attributes inherited from FDEntry
bool _closeOnExec
 

Detailed Description

Holds file descriptors for host-backed files; host-backed files are files which were opened on the physical machine where the simulation is running (probably the thing on/under your desk).

All regular files are redirected to make it appear that the file descriptor assignment starts at file descriptor '3' (not including stdin, stdout, stderr) and then grows upward.

Definition at line 110 of file fd_entry.hh.

Constructor & Destructor Documentation

◆ FileFDEntry() [1/2]

FileFDEntry::FileFDEntry ( int  sim_fd,
int  flags,
std::string const &  file_name,
uint64_t  file_offset,
bool  close_on_exec = false 
)
inline

Definition at line 113 of file fd_entry.hh.

◆ FileFDEntry() [2/2]

FileFDEntry::FileFDEntry ( FileFDEntry const &  reg,
bool  close_on_exec = false 
)
inline

Definition at line 119 of file fd_entry.hh.

Member Function Documentation

◆ clone()

std::shared_ptr<FDEntry> FileFDEntry::clone ( ) const
inlineoverridevirtual

Reimplemented from HBFDEntry.

Definition at line 125 of file fd_entry.hh.

◆ getFileName()

std::string const& FileFDEntry::getFileName ( ) const
inline

Definition at line 130 of file fd_entry.hh.

References _fileName.

◆ getFileOffset()

uint64_t FileFDEntry::getFileOffset ( ) const
inline

Definition at line 131 of file fd_entry.hh.

References _fileOffset.

◆ serialize()

void FileFDEntry::serialize ( CheckpointOut cp) const
overridevirtual

Serialize an object.

Output an object's state into the current checkpoint section.

Parameters
cpCheckpoint state

Reimplemented from FDEntry.

Definition at line 51 of file fd_entry.cc.

References FDEntry::_closeOnExec, _fileName, _fileOffset, HBFDEntry::_flags, and SERIALIZE_SCALAR.

◆ setFileName()

void FileFDEntry::setFileName ( std::string const &  file_name)
inline

Definition at line 133 of file fd_entry.hh.

References _fileName.

◆ setFileOffset()

void FileFDEntry::setFileOffset ( uint64_t  f_off)
inline

Definition at line 134 of file fd_entry.hh.

References _fileOffset.

◆ unserialize()

void FileFDEntry::unserialize ( CheckpointIn cp)
overridevirtual

Unserialize an object.

Read an object's state from the current checkpoint section.

Parameters
cpCheckpoint state

Reimplemented from FDEntry.

Definition at line 60 of file fd_entry.cc.

References FDEntry::_closeOnExec, _fileName, _fileOffset, HBFDEntry::_flags, and UNSERIALIZE_SCALAR.

Member Data Documentation

◆ _fileName

std::string FileFDEntry::_fileName
private

Definition at line 140 of file fd_entry.hh.

Referenced by getFileName(), serialize(), setFileName(), and unserialize().

◆ _fileOffset

uint64_t FileFDEntry::_fileOffset
private

Definition at line 141 of file fd_entry.hh.

Referenced by getFileOffset(), serialize(), setFileOffset(), and unserialize().


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

Generated on Wed Sep 30 2020 14:02:24 for gem5 by doxygen 1.8.17