Marine Library  1.0
C++ library for Linux Networking Development
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
CPosixShmFile Class Reference
Inheritance diagram for CPosixShmFile:
Inheritance graph
[legend]
Collaboration diagram for CPosixShmFile:
Collaboration graph
[legend]

Public Member Functions

 CPosixShmFile (const char *shmname, int flags=__MyBase::kFlagsDefault, mode_t mode=__MyBase::kModeDefault)
 
 CPosixShmFile (const std::string &shmname, int flags=__MyBase::kFlagsDefault, mode_t mode=__MyBase::kModeDefault)
 
 CPosixShmFile (const CPosixShmFile &other)
 
CPosixShmFileoperator= (const CPosixShmFile &other)
 
int fdType () const
 Get type id of this object. More...
 
const char * fdTypeName () const
 Get readable description of this object. More...
 
std::string shmname () const
 
bool open (const char *shmname, int flags=kFlagsDefault, mode_t mode=kModeDefault)
 
bool open (const std::string &shmname, int flags=kFlagsDefault, mode_t mode=kModeDefault)
 
bool unlink ()
 Remove file. More...
 
std::string toString () const
 Get readable description of this object. More...
 
- Public Member Functions inherited from CFile
 CFile ()
 Default constructor.
 
bool rename (const std::string &newfile)
 Rename file. More...
 
 CFile (const char *pathname, int flags=kFlagsDefault, mode_t mode=kModeDefault)
 
 CFile (const std::string &pathname, int flags=kFlagsDefault, mode_t mode=kModeDefault)
 
 CFile (const CFile &other)
 
CFileoperator= (const CFile &other)
 
ssize_t read (char *buf, size_t size)
 
bool read (std::vector< char > &buf, size_t size, bool append)
 
bool read (std::string &buf, size_t size, bool append)
 
ssize_t write (const char *buf, size_t size)
 
ssize_t write (const std::vector< char > &buf)
 
ssize_t write (const std::string &buf)
 
bool seek (off_t offset, int whence)
 
bool seek64 (off64_t offset, int whence)
 
off_t tell () const
 
off64_t tell64 () const
 
- Public Member Functions inherited from IFileDesc
 IFileDesc ()
 Construct a default object.
 
virtual ~IFileDesc ()
 Destroy this object. More...
 
bool valid () const
 Test if this object is a valid file descriptor. More...
 
int fd () const
 Get fd (file descriptor). More...
 
std::string filename () const
 Get file name opened by this object. More...
 
off_t length () const
 Get byte size of file opened by this object. More...
 
bool deleted () const
 Test if file is deleted. More...
 
bool block (bool on)
 Set block/non-block for operations. More...
 
void close ()
 Close this fd.
 

Static Public Member Functions

static bool Unlink (const std::string &shmname)
 
- Static Public Member Functions inherited from CFile
static bool Unlink (const std::string &pathname)
 Remove a file. More...
 
static bool Rename (const std::string &oldfile, const std::string &newfile)
 Rename a file. More...
 
- Static Public Member Functions inherited from IFileDesc
static std::string ErrMsg ()
 Get latest errno and error message. More...
 

Static Public Attributes

static const int kFdType = 5
 
- Static Public Attributes inherited from CFile
static const int kFdType = 1
 Type id.
 
- Static Public Attributes inherited from IFileDesc
static const int kInvalidFd = -1
 

Member Function Documentation

int CPosixShmFile::fdType ( ) const
inlinevirtual

Get type id of this object.

Any concrete class derived from IFileDesc shall define a distinct type id named kFdType, so it's possible to check this id and determine what the object really is.
Currently following kFdTypes are defined:

Type Id Value
CFile::kFdType 1
CTcpConnSocket::kFdType 2
CListenSocket::kFdType 3
CUdpSocket::kFdType 4
CPosixShmFile::kFdType 5
CEpoll::kFdType 6
Returns
Type id of this object
See also
kFdType

Reimplemented from CFile.

const char* CPosixShmFile::fdTypeName ( ) const
inlinevirtual

Get readable description of this object.

Returns
"CFile"

Reimplemented from CFile.

std::string CPosixShmFile::toString ( ) const
inlinevirtual

Get readable description of this object.

Returns
Description string

Reimplemented from CFile.

bool CPosixShmFile::unlink ( )
inlinevirtual

Remove file.

Returns
true if succeeded; false otherwise
See also
ErrMsg

Reimplemented from CFile.


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