1 #ifndef CENTRAL_MAILBOX_CLASS
2 #define CENTRAL_MAILBOX_CLASS
108 void clean_package_list(
post_office &post, letter_morph &to_clean);
Provides a dynamically resizable ASCII character string.
Provides a platform-independent object for adding threads to a program.
A virtual base class for pieces of "mail". Used by the mailbox object.
Base class for routes on which letters are automatically delivered.
Implements a thread safe "mail" delivery system.
Manages a collection of mailboxes and implements delivery routes for mail.
bool pick_up(const structures::unique_int &id, letter *&package)
retrieves a "package" intended for the "id" if one exists.
DEFINE_CLASS_NAME("post_office")
bool register_route(const structures::unique_int &id, mail_stop &carrier_path)
registers a route "carrier_path" for mail deliveries to the "id".
bool unregister_route(const structures::unique_int &id)
removes a route for the "id".
virtual ~post_office()
stop_serving must be invoked prior to this destructor.
void show_routes(basis::astring &to_fill)
writes a listing of the current routes into "to_fill".
void show_mail(basis::astring &to_fill)
prints a snapshot of all currently pending letters into "to_fill".
void stop_serving()
gets the mailbox to stop delivering items prior to a shutdown.
void drop_off(const structures::unique_int &id, letter *package)
sends a "package" on its way to the "id" via the registered route.
bool route_listed(const structures::unique_int &id)
returns true if there is a route listed for the "id".
bool deliver_mail_on_route(const structures::unique_int &route, ethread &carrier)
for internal use only–delivers the letters to known routes.
Manages a collection of threads.
A simple object that wraps a templated set of ints.
A unique identifier based on integers.
Represents a point in time relative to the operating system startup time.