Event Class Reference

#include <event.h>

List of all members.

Public Member Functions

 Event ()
void setStatus (char status) throw ( invalid_argument )
char getStatus () const
void println (ostream &out=cout) const
bool operator== (const Event &e) const
bool operator!= (const Event &e) const
bool operator< (const Event &e) const
bool operator> (const Event &e) const

Private Member Functions

string readDoubleQuotedString (istream &in) const

Private Attributes

char status
string id
string name
string location
DateTime start
DateTime end
DateTime modified

Friends

ostream & operator<< (ostream &out, const Event &e)
istream & operator>> (istream &in, Event &e) throw ( invalid_argument )

Detailed Description

A class for storing information about a calendar event. An Event consists of a status, a unique identifier, a name, a location, a start date and time, an end date and time, and a date and time of the event's last modification. The class include methods for reading and writing events in both external and internal formats. That is, the internal format consists of all information, which is required for transfer, storage, and synchronization. The external format consists of information required for a user view: the name, location, and start and end times of the event.

Author:
Mark Maloof (maloof cs georgetown edu)
Version:
1.1, 11/28/12

Constructor & Destructor Documentation

Event::Event (  ) 

Default constructor. Sets status to a default value of 'A', indicating an active record. String and DateTime objects keep their default values.


Member Function Documentation

char Event::getStatus (  )  const

Returns this Event object's status.

char a character representing this object's status

bool Event::operator!= ( const Event e  )  const

Returns true if this object's unique identifier is not equal to that of the Event object passed as the parameter; returns false otherwise.

Parameters:
e the Event object to be compared
Returns:
the bool indicating whether the objects are not equal
bool Event::operator< ( const Event e  )  const

Returns true if this Event object's modification date is less than (i.e., earlier than) the parameter's modification date; returns false otherwise.

Parameters:
e the Event object to be compared
Returns:
the bool indicating whether this object is less than the parameter
bool Event::operator== ( const Event e  )  const

Returns true if this object's unique identifier is equal to that of the Event object passed as the parameter; returns false otherwise.

Parameters:
e the Event object to be compared
Returns:
the bool indicating whether the objects are equal
bool Event::operator> ( const Event e  )  const

Returns true if this Event object's modification date is greater than (i.e., later than) the parameter's modification date; returns false otherwise.

Parameters:
e the Event object to be compared
Returns:
the bool indicating whether this object is greater than the parameter
void Event::println ( ostream &  out = cout  )  const

Prints this Event object in the external format (i.e., a format that would be useful for display in an interface).

Parameters:
out the output stream for writing
string Event::readDoubleQuotedString ( istream &  in  )  const [private]

Reads the next character sequence between two double quotation marks from the input stream and returns the characters as a string. The first printable character in the stream must be a double quote.

Parameters:
in the input stream for reading
Returns:
a string containing the character sequence
void Event::setStatus ( char  status  )  throw ( invalid_argument )

Sets the status of this Event object. The status of an Event object is either 'A' for an active event or 'D' for a deleted object. For invalid values for status, the method throws invalid_argument.

Parameters:
status a character indicating this Event object's status
Exceptions:
invalid_argument if an argument's value is invalid

Friends And Related Function Documentation

ostream& operator<< ( ostream &  out,
const Event e 
) [friend]

Inserts an Event object in the internal format into the output stream, and returns the modified output stream.

Parameters:
out the output stream for insertion
e the Event for insertion
Returns:
the modified output stream
istream& operator>> ( istream &  in,
Event e 
) throw ( invalid_argument ) [friend]

Extracts an Event object in an internal format from the input stream and returns the modified input stream. The internal format of an object consists of its status, unique identifier, name, location, start date and time, end date and time, and the date and time of the event's last modification.

Parameters:
in the input stream for extraction
e the Event for storing the extracted information
Returns:
the modified input stream
Exceptions:
invalid_argument if an argument's value is invalid

Member Data Documentation

DateTime Event::end [private]

the date and end time of the event

string Event::id [private]

the unique identifier of the event record

string Event::location [private]

the location of the event

the date and time of the event record's last modification

string Event::name [private]

the name of the event

the date and start time of the event

char Event::status [private]

the status of the event record


The documentation for this class was generated from the following files:
Generated on Thu Jan 24 09:03:33 2013 by  doxygen 1.6.3