In file mailboxd.cxx:

class CMailboxCollection

Mailbox collection class.

Public Methods

[more] CMailboxCollection ()
Default constructor. Initializes the mailbox collection with empty data.
[more] ~CMailboxCollection ()
Default destructor. Deletes all the contained mailbox objects and frees the used memory.
[more]int FindMailbox (const char * strName, int iStartPos=0)
Finds a mailbox by name.
[more]int FindMailbox (int iSocket)
Finds a mailbox by socket.
[more]void UpdateWriteSet (fd_set * write_fd_set)
Updates the socket write set.
[more]bool AddMailbox (int iSocket)
Adds a new mailbox.
[more]void WriteEnqueuedData (int iSocket)
Writes the enqueued data for the given socket.
[more]bool CloseMailbox (const char * strName)
Closes the mailbox which has a given name.
[more]bool CloseMailbox (int iSocket)
Closes the mailbox which has a given name.
[more]void CloseMailboxes ()
Closes all the mailboxes
[more]bool CharFromSocket (int iSocket, unsigned char ch)
Notify character. Notify the mailbox associated to given socket of a character arrival.

Protected Fields

[more]CMailbox** m_ppmbx
Internal mailbox array.
[more]int m_iAllocated
Number of allocated mailboxes.
[more]int m_iUsed
Number of used mailboxes.


Documentation

Mailbox collection class.
oCMailbox** m_ppmbx
Internal mailbox array. This data member points to a dynamically allocated area which contains the pointers to all the allocated mailbox objects.

oint m_iAllocated
Number of allocated mailboxes. This is the number of dynamically allocated mailbox objects.

oint m_iUsed
Number of used mailboxes. This is the count of the mailboxes currently in use, that is to say the mailboxes which have a name and an associated process and socket.

o CMailboxCollection()
Default constructor. Initializes the mailbox collection with empty data.

o ~CMailboxCollection()
Default destructor. Deletes all the contained mailbox objects and frees the used memory.

oint FindMailbox(const char * strName, int iStartPos=0)
Finds a mailbox by name. Returns the number of the first mailbox which has the given name, starting from the given point.
Returns:
the number of the mailbox which has the given name, or the value -1 if no mailboxes with the given name can be found.
Parameters:
strName - this is the name of the mailbox you want to find.
iStartPos - the number to start from in the search.

oint FindMailbox(int iSocket)
Finds a mailbox by socket. Returns the number of the mailbox which is associated to the given socket.
Returns:
the number of the mailbox which has the given name, or the value -1 if no mailboxes with the given name can be found.
Parameters:
iSocket - this is the socket associated to the mailbox you want to find.

ovoid UpdateWriteSet(fd_set * write_fd_set)
Updates the socket write set. Updates the set of sockets which should be kept under observation to flush pending outgoing data. To achieve this, every used mailbox in the collection is examined to see whether it has pending data.

obool AddMailbox(int iSocket)
Adds a new mailbox. Sets a new mailbox up with the given socket number. If every allocated mailbox is used, a new set of empty mailbox (of cardinality ALLOC\_GRANULARITY) is allocated.

ovoid WriteEnqueuedData(int iSocket)
Writes the enqueued data for the given socket. Identifies the socket in the collection which has the given socket and, using its WriteEnqueuedData method, asks it to write (if possible) pending outgoing data.

obool CloseMailbox(const char * strName)
Closes the mailbox which has a given name. The mailbox with the given name is reinitialized, every pending data is lost.

obool CloseMailbox(int iSocket)
Closes the mailbox which has a given name. The mailbox with the given socket is reinitialized, every pending data is lost.

ovoid CloseMailboxes()
Closes all the mailboxes

obool CharFromSocket(int iSocket, unsigned char ch)
Notify character. Notify the mailbox associated to given socket of a character arrival.


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.