feisty meow concerns codebase  2.140
processes::letter Class Referenceabstract

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

#include <letter.h>

Inheritance diagram for processes::letter:
Collaboration diagram for processes::letter:

Public Member Functions

 letter (int type=0, int start_after=0)
 constructs a letter with the "type" and initial pause of "start_after". More...
 
 letter (const letter &to_copy)
 copy constructor for base parts. More...
 
virtual ~letter ()
 derived classes should also implement this. More...
 
letteroperator= (const letter &to_copy)
 assignment operator for base object. More...
 
virtual void text_form (basis::base_string &fill) const =0
 derived letters must print a status blurb describing their contents. More...
 
int type () const
 returns the type of letter held here. More...
 
bool ready_to_send ()
 returns true if this letter is ready to More...
 
void set_ready_time (int start_after)
 resets the time when this letter is ready to be sent. More...
 
- Public Member Functions inherited from basis::text_formable
virtual const char * class_name () const =0
 Returns the bare name of this class as a constant character pointer. More...
 

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

◆ letter() [1/2]

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.

◆ letter() [2/2]

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

copy constructor for base parts.

Definition at line 31 of file letter.cpp.

◆ ~letter()

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

◆ operator=()

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

assignment operator for base object.

Definition at line 48 of file letter.cpp.

◆ ready_to_send()

bool processes::letter::ready_to_send ( )

returns true if this letter is ready to

Definition at line 43 of file letter.cpp.

◆ set_ready_time()

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.

◆ text_form()

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().

◆ type()

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: