processes::letter Class Reference

A virtual base class for pieces of "mail". Used by the mailbox object. More...

#include <letter.h>

Inheritance diagram for processes::letter:
Inheritance graph
[legend]
Collaboration diagram for processes::letter:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 letter (int type=0, int start_after=0)
 constructs a letter with the "type" and initial pause of "start_after".
 letter (const letter &to_copy)
 copy constructor for base parts.
virtual ~letter ()
 derived classes should also implement this.
letteroperator= (const letter &to_copy)
 assignment operator for base object.
virtual void text_form (basis::base_string &fill) const =0
 derived letters must print a status blurb describing their contents.
int type () const
 returns the type of letter held here.
bool ready_to_send ()
 returns true if this letter is ready to
void set_ready_time (int start_after)
 resets the time when this letter is ready to be sent.

Detailed Description

A virtual base class for pieces of "mail". Used by the mailbox object.

Definition at line 24 of file letter.h.


Constructor & Destructor Documentation

processes::letter::letter ( int  type = 0,
int  start_after = 0 
)

constructs a letter with the "type" and initial pause of "start_after".

a "type" for this letter must be specified, even if it is not intended to be used. some letter managers may rely on this number identifying different kinds of mail. the types should be unique within one mailbox. a "type" of zero indicates an invalid letter. if the "start_after" is non-zero, then it indicates that this letter should not be sent until that many milliseconds have elapsed.

Definition at line 26 of file letter.cpp.

processes::letter::letter ( const letter to_copy  ) 

copy constructor for base parts.

Definition at line 31 of file letter.cpp.

processes::letter::~letter (  )  [virtual]

derived classes should also implement this.

a virtual destructor should be implemented by each derived class to take care of class specific cleaning. note that the destructor should NEVER attempt to use the mailbox system that it was stored in (or any other mailbox system for that matter). this is necessary for prohibiting deadlock conditions, but it's not that much of a restriction usually.

Definition at line 37 of file letter.cpp.

References basis::WHACK().


Member Function Documentation

letter & processes::letter::operator= ( const letter to_copy  ) 

assignment operator for base object.

Definition at line 48 of file letter.cpp.

bool processes::letter::ready_to_send (  ) 

returns true if this letter is ready to

Definition at line 43 of file letter.cpp.

void processes::letter::set_ready_time ( int  start_after  ) 

resets the time when this letter is ready to be sent.

the letter will now not be allowed to send until "start_after" milliseconds from now. once the letter is added to a mailbox, it may be too late to adjust this duration.

Definition at line 45 of file letter.cpp.

virtual void processes::letter::text_form ( basis::base_string fill  )  const [pure virtual]

derived letters must print a status blurb describing their contents.

Implements basis::text_formable.

Implemented in processes::OS_event.

Referenced by processes::post_office::drop_off(), processes::post_office::pick_up(), and processes::mailbox::show().

int processes::letter::type (  )  const [inline]

returns the type of letter held here.

Definition at line 53 of file letter.h.


The documentation for this class was generated from the following files:
Generated on Sat Jan 28 04:25:50 2012 for hoople2 project by  doxygen 1.6.3