μHAL (v2.8.17)
Part of the IPbus software repository
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Private Attributes | List of all members
uhal::Mmap::File Class Reference

Public Member Functions

 File (const std::string &aPath, int aFlags)
 
 ~File ()
 
const std::string & getPath () const
 
void setPath (const std::string &aPath)
 
void setOffset (size_t aOffset)
 
void open ()
 
void close ()
 
void read (const uint32_t aAddr, const uint32_t aNrWords, std::vector< uint32_t > &aValues)
 
void write (const uint32_t aAddr, const std::vector< std::pair< const uint8_t *, size_t > > &aData)
 
bool haveLock () const
 
void lock ()
 
void unlock ()
 

Private Attributes

std::string mPath
 
int mFd
 
int mFlags
 
bool mLocked
 
off_t mOffset
 
void * mMmapPtr
 
void * mMmapIOPtr
 

Detailed Description

Definition at line 83 of file ProtocolMmap.hpp.

Constructor & Destructor Documentation

◆ File()

uhal::Mmap::File::File ( const std::string &  aPath,
int  aFlags 
)

Definition at line 76 of file ProtocolMmap.cpp.

◆ ~File()

uhal::Mmap::File::~File ( )

Definition at line 88 of file ProtocolMmap.cpp.

Member Function Documentation

◆ close()

void uhal::Mmap::File::close ( )

Definition at line 147 of file ProtocolMmap.cpp.

References uhal::Error, uhal::Integer(), uhal::log(), MAP_SIZE, and uhal::Quote().

Referenced by uhal::Mmap::disconnect().

◆ getPath()

const std::string & uhal::Mmap::File::getPath ( ) const

Definition at line 94 of file ProtocolMmap.cpp.

Referenced by uhal::Mmap::connect(), uhal::Mmap::read(), and uhal::Mmap::write().

◆ haveLock()

bool uhal::Mmap::File::haveLock ( ) const

Definition at line 247 of file ProtocolMmap.cpp.

Referenced by uhal::Mmap::connect(), and uhal::Mmap::write().

◆ lock()

void uhal::Mmap::File::lock ( )

Definition at line 253 of file ProtocolMmap.cpp.

References uhal::Integer(), uhal::log(), and uhal::Quote().

Referenced by uhal::Mmap::write().

◆ open()

void uhal::Mmap::File::open ( )

Definition at line 121 of file ProtocolMmap.cpp.

References uhal::Integer(), uhal::log(), MAP_SIZE, and uhal::Quote().

◆ read()

void uhal::Mmap::File::read ( const uint32_t  aAddr,
const uint32_t  aNrWords,
std::vector< uint32_t > &  aValues 
)

◆ setOffset()

void uhal::Mmap::File::setOffset ( size_t  aOffset)

Definition at line 106 of file ProtocolMmap.cpp.

Referenced by uhal::Mmap::Mmap().

◆ setPath()

void uhal::Mmap::File::setPath ( const std::string &  aPath)

Definition at line 100 of file ProtocolMmap.cpp.

◆ unlock()

void uhal::Mmap::File::unlock ( )

◆ write()

void uhal::Mmap::File::write ( const uint32_t  aAddr,
const std::vector< std::pair< const uint8_t *, size_t > > &  aData 
)

Definition at line 191 of file ProtocolMmap.cpp.

References uhal::Integer(), uhal::log(), MAP_SIZE, and uhal::SigBusGuard::protect().

Referenced by uhal::Mmap::write().

Member Data Documentation

◆ mFd

int uhal::Mmap::File::mFd
private

Definition at line 108 of file ProtocolMmap.hpp.

◆ mFlags

int uhal::Mmap::File::mFlags
private

Definition at line 109 of file ProtocolMmap.hpp.

◆ mLocked

bool uhal::Mmap::File::mLocked
private

Definition at line 110 of file ProtocolMmap.hpp.

◆ mMmapIOPtr

void* uhal::Mmap::File::mMmapIOPtr
private

Definition at line 113 of file ProtocolMmap.hpp.

◆ mMmapPtr

void* uhal::Mmap::File::mMmapPtr
private

Definition at line 112 of file ProtocolMmap.hpp.

◆ mOffset

off_t uhal::Mmap::File::mOffset
private

Definition at line 111 of file ProtocolMmap.hpp.

◆ mPath

std::string uhal::Mmap::File::mPath
private

Definition at line 107 of file ProtocolMmap.hpp.


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