MDSTk Libraries  1.1.0
Medical Data Segmentation Toolkit
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
mds::sys::CNamedPipe Class Reference

Named pipe. More...

#include <mdsNamedPipe.h>

Inheritance diagram for mds::sys::CNamedPipe:
Inheritance graph
[legend]

List of all members.

Public Types

enum  { CLASS_OBJECT }
 Templates that require members of the CObject class can use this enum to check the existence. More...
enum  { HEAP_OBJECT = 0x70616568 }
 Signature used to recognize objects on the heap. More...

Public Member Functions

 CNamedPipe (const std::string &sName, int Type)
 Constructor.
bool connect (unsigned uTimeout)
 Connects to a specified named pipe.
void disconnect ()
 Disconnects the named pipe.
int getReferencesCount () const
 Returns the number of references.
bool isConnected ()
 Returns true if the pipe is successfully connected.
bool isOnHeap () const
 Returns true if the object is allocated on the heap.
bool listen (unsigned uTimeout)
 Listens to a specified named pipe.
 MDS_SHAREDPTR (CNamedPipe)
 Smart pointer type.
int read (char *pData, int iLength)
 Reads 'iLength' bytes from the named pipe.
int state () const
 Returns actual state of the pipe.
int type () const
 Returns type of the named pipe.
bool wait (unsigned uTimeout)
 Waits for data.
bool write (const char *pData, int iLength)
 Writes data to the named pipe.
virtual ~CNamedPipe ()
 Destuctor.

Static Public Member Functions

static void * operator new (std::size_t Size)
 Allocates a new object on the heap.

Protected Member Functions

void addReference () const
 Increase the reference counter.
bool delReference () const
 Decrease the reference counter.

Protected Attributes

int m_iHeapObject
 Flag initialized if the object is on the heap.
int m_iReferences
 The number of references to the object.
std::string m_sName
 Name of the pipe.
int m_State
 State of the pipe.
int m_Type
 Type of the named pipe.

Detailed Description

Named pipe.


Member Enumeration Documentation

anonymous enum [inherited]

Templates that require members of the CObject class can use this enum to check the existence.

Enumerator:
CLASS_OBJECT 
anonymous enum [inherited]

Signature used to recognize objects on the heap.

Enumerator:
HEAP_OBJECT 

Constructor & Destructor Documentation

mds::sys::CNamedPipe::CNamedPipe ( const std::string &  sName,
int  Type 
)

Constructor.

virtual mds::sys::CNamedPipe::~CNamedPipe ( ) [virtual]

Destuctor.


Member Function Documentation

void mds::base::CObject::addReference ( ) const [protected, inherited]

Increase the reference counter.

bool mds::sys::CNamedPipe::connect ( unsigned  uTimeout)

Connects to a specified named pipe.

  • Returns false on failure or if a given timeout elapses.
bool mds::base::CObject::delReference ( ) const [protected, inherited]

Decrease the reference counter.

  • Returns true if the decremented number of references is lower or equal to zero and object must be deleted.

Disconnects the named pipe.

Returns the number of references.

Returns true if the pipe is successfully connected.

bool mds::base::CObject::isOnHeap ( ) const [inherited]

Returns true if the object is allocated on the heap.

bool mds::sys::CNamedPipe::listen ( unsigned  uTimeout)

Listens to a specified named pipe.

  • Returns false on failure or if a given timeout elapses.

Smart pointer type.

static void* mds::base::CObject::operator new ( std::size_t  Size) [static, inherited]

Allocates a new object on the heap.

int mds::sys::CNamedPipe::read ( char *  pData,
int  iLength 
)

Reads 'iLength' bytes from the named pipe.

  • In case of error the number of successfully read bytes is returned.

Returns actual state of the pipe.

Returns type of the named pipe.

bool mds::sys::CNamedPipe::wait ( unsigned  uTimeout)

Waits for data.

  • Until the data received event is signalled.
  • Returns false if a timeout elapses or the channel is not input.
bool mds::sys::CNamedPipe::write ( const char *  pData,
int  iLength 
)

Writes data to the named pipe.


Member Data Documentation

int mds::base::CObject::m_iHeapObject [mutable, protected, inherited]

Flag initialized if the object is on the heap.

int mds::base::CObject::m_iReferences [mutable, protected, inherited]

The number of references to the object.

  • Zero if there is no reference.
std::string mds::sys::CNamedPipe::m_sName [protected]

Name of the pipe.

State of the pipe.

Type of the named pipe.


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