Copyright © 1997 The California Institute of Technology
All rights reserved.

Class: FeiMailReport


For more information on the class, see the header file: FeiMailReport.h


int FeiMailReport::addToReport (char *string)

Add a string that will be part of the next mail report. If we reach the limit of the size of the list, signal the scheduler to make a report now. This will empty the list of strings to report and a new report is started. (The scheduler continues to make its regularly scheduled reports.


FeiMailReport::~FeiMailReport (void)

Stop the mail scheduler. Issues a final report if the file description list has any entries and then clean up data structures. Issuance of the final report can be stopped by disabling reporting, setEnabled (false).


inline const char *FeiMailReport::getMsg (void)

Returns the message associated with the last detected error. Use getStatus to test for error conditions. If no error has occured this buffer contain nothing but a 0 byte.


inline int FeiMailReport::getStatus (void)

Returns the current status of the object. Returns FEI_OK if reporting is possible. A value of FEI_ERROR means reporting was disabled because of an error. A value of FEI_FATAL means the object was not able to get a resource. Failure to allocate memory is the primary case when value is reported. See also getMsg.


int FeiMailReport::mailReport (FeiMtList::Node * list)

Create a mail message by writing each line in the report list to the supplied mail address. If a subject was defined, that is added to the mailed report. Once reported, the items in the list and the list itself are deleted.

If there's nothing in the list, then no report is made. Add items to the report using addToReport.


int FeiMailReport::setReportTime (const char *listOfTimes)

Sets report times used by the scheduler and starts the scheduler thread once the first report time is successfully registered. Time specifiications are passed in as a list of time in a string, for example: 07:30 12:00 17:15. This method can be called more than once to add additional times.

This method manipulates used by the scheduler, so it contains a critical section protected by a mutex. This insures that the scheduler does not access data at the same time it's being entered.

The function returns FEI_OK on success, some other status value on error.