Garmin Fleet Management Controller  2.19.0
StopListItem Class Reference

Data structure to hold details of an A603 stop that the server needs to keep. More...

#include <StopListItem.h>

+ Inheritance diagram for StopListItem:

Public Types

typedef uint32 key_type
 

Public Member Functions

 StopListItem ()
 Constructor. More...
 
void commitName ()
 Commit the item name. More...
 
CString getCurrentName () const
 Get the current name of this item. More...
 
const key_typegetId () const
 Get item's ID. More...
 
stop_status_status_type getStopStatus () const
 Get the stop status. More...
 
BOOL isValid () const
 Check whether this item is valid. More...
 
virtual void readFromStream (std::istream &aStream)
 Read a ClientListItem from an input stream. More...
 
void setCurrentName (CString aName)
 Set the current name of the stop. More...
 
void setId (const key_type &aId)
 Set item's ID. More...
 
void setParent (FileBackedMap< StopListItem > *aParent)
 Set the parent. More...
 
void setParent (FileBackedMap< ClientListItem > *aParent)
 Set the parent. More...
 
void setStopStatus (stop_status_status_type aStatus)
 Set the stop status. More...
 
void setUpdateName (CString aName)
 Set pending name. More...
 
void setValid (BOOL aValid=TRUE)
 Set this item as valid. More...
 
virtual void writeToStream (std::ofstream &aStream) const
 Write a ClientListItem to an output stream. More...
 

Protected Member Functions

virtual void save ()
 Save this item. More...
 

Protected Attributes

CString mCurrentName
 The last name acknowledged by the client. More...
 
key_type mId
 The unique ID of this item. More...
 
BOOL mIsValid
 True if this list item is mIsValid. More...
 
CString mUpdateName
 The last name entered by the user. More...
 

Private Attributes

FileBackedMap< StopListItem > * mParent
 The map that this item belongs to, or NULL if none. More...
 
stop_status_status_type mStopStatus
 The last known stop status for this stop. More...
 

Detailed Description

Data structure to hold details of an A603 stop that the server needs to keep.

Since
Protocol A603

Definition at line 21 of file StopListItem.h.

Member Typedef Documentation

Definition at line 24 of file StopListItem.h.

Constructor & Destructor Documentation

StopListItem::StopListItem ( )

Constructor.

Definition at line 16 of file StopListItem.cpp.

References INVALID_STOP_STATUS, and mStopStatus.

Member Function Documentation

void ClientListItem::commitName ( )
inherited

Commit the item name.

Commit the item name and set the ClientListItem as valid

Definition at line 29 of file ClientListItem.cpp.

References ClientListItem::mCurrentName, ClientListItem::mUpdateName, and ClientListItem::setValid().

Referenced by FmiApplicationLayer::rx().

CString ClientListItem::getCurrentName ( ) const
inherited

Get the current name of this item.

Returns
The current (committed) name

Definition at line 39 of file ClientListItem.cpp.

References ClientListItem::mCurrentName.

Referenced by CDriverIdAndStatusDlg::OnLbnSelchangeStatuslist(), FmiApplicationLayer::procDriverStatusUpdate(), CSendSensorDlg::RefreshList(), and FmiApplicationLayer::rx().

const ClientListItem::key_type & ClientListItem::getId ( ) const
inherited

Get item's ID.

Get the unique ID of this item

Returns
The item's ID

Definition at line 49 of file ClientListItem.cpp.

References ClientListItem::mId.

Referenced by FmiApplicationLayer::rx().

stop_status_status_type StopListItem::getStopStatus ( ) const

Get the stop status.

Returns
the status of the stop

Definition at line 31 of file StopListItem.cpp.

References mStopStatus, and setStopStatus().

Referenced by CStopListDlg::OnEventStopListChanged().

BOOL ClientListItem::isValid ( ) const
inherited

Check whether this item is valid.

Returns
TRUE if the item is valid, FALSE otherwise

Definition at line 58 of file ClientListItem.cpp.

References ClientListItem::mIsValid, and ClientListItem::readFromStream().

Referenced by CFileTransferDlg::AddPSRtoStopList(), CAobrdDriversDlg::OnBnClickedSet(), FmiApplicationLayer::procDriverStatusUpdate(), and FmiApplicationLayer::rx().

void StopListItem::readFromStream ( std::istream &  aStream)
virtual

Read a ClientListItem from an input stream.

Read id and current name from the input stream, and updates the member variables appropriately.

Parameters
aStreamThe stream to read from

Reimplemented from ClientListItem.

Definition at line 21 of file StopListItem.cpp.

References INVALID_STOP_STATUS, mStopStatus, and ClientListItem::readFromStream().

void ClientListItem::save ( )
protectedvirtualinherited

Save this item.

Invokes parent to save all items

Reimplemented in AobrdDriverItem, WaypointListItem, and DriverLoginItem.

Definition at line 172 of file ClientListItem.cpp.

References ClientListItem::mParent, and FileBackedMap< T >::save().

Referenced by ClientListItem::setValid().

void StopListItem::setCurrentName ( CString  aName)

Set the current name of the stop.

Parameters
aNameThe new name of the stop

Definition at line 65 of file StopListItem.cpp.

References ClientListItem::mCurrentName.

Referenced by CFileTransferDlg::AddPSRtoStopList(), CMapViewerDlg::addStopToCatalog(), CStopNewDlg::OnBnClickedOk(), FmiApplicationLayer::sendA603Stop(), CMapViewerDlg::sendRouteToDevice(), and setParent().

void ClientListItem::setId ( const key_type aId)
inherited
void StopListItem::setParent ( FileBackedMap< StopListItem > *  aParent)

Set the parent.

Parameters
aParentThe FileBackedMap that contains this item

Definition at line 53 of file StopListItem.cpp.

References mParent, and setCurrentName().

Referenced by setStopStatus().

void ClientListItem::setParent ( FileBackedMap< ClientListItem > *  aParent)
inherited

Set the parent.

Parameters
aParentThe FileBackedMap that contains this item

Definition at line 113 of file ClientListItem.cpp.

References ClientListItem::mParent, and ClientListItem::setUpdateName().

Referenced by ClientListItem::setId().

void StopListItem::setStopStatus ( stop_status_status_type  aStatus)
void ClientListItem::setUpdateName ( CString  aName)
inherited

Set pending name.

Set the pending name of this ClientListItem. This does not become the item's name until commitName is called.

Parameters
aNameThe pending name to set

Definition at line 127 of file ClientListItem.cpp.

References ClientListItem::mUpdateName, and ClientListItem::setValid().

Referenced by FmiApplicationLayer::sendCannedMessage(), FmiApplicationLayer::sendCannedResponse(), FmiApplicationLayer::sendCreateWaypointCat(), FmiApplicationLayer::sendDriverStatusListItem(), FmiApplicationLayer::sendWaypoint(), and ClientListItem::setParent().

void ClientListItem::writeToStream ( std::ofstream &  aStream) const
virtualinherited

Write a ClientListItem to an output stream.

Append id and current name to the output stream.

Parameters
aStreamThe stream to write to

Reimplemented in AobrdDriverItem, DriverLoginItem, and WaypointListItem.

Definition at line 155 of file ClientListItem.cpp.

References ClientListItem::mCurrentName, and ClientListItem::mId.

Referenced by ClientListItem::setValid(), WaypointListItem::writeToStream(), and SensorListItem::writeToStream().

Member Data Documentation

CString ClientListItem::mCurrentName
protectedinherited
key_type ClientListItem::mId
protectedinherited

The unique ID of this item.

Definition at line 84 of file ClientListItem.h.

Referenced by ClientListItem::getId(), ClientListItem::readFromStream(), ClientListItem::setId(), and ClientListItem::writeToStream().

FileBackedMap<StopListItem>* StopListItem::mParent
private

The map that this item belongs to, or NULL if none.

Definition at line 59 of file StopListItem.h.

Referenced by setParent().

stop_status_status_type StopListItem::mStopStatus
private

The last known stop status for this stop.

Note
This may be out of date if the stop status protocol is throttled or if the update process that occurs when the server begins communicating with the client has not completed.

Definition at line 56 of file StopListItem.h.

Referenced by getStopStatus(), readFromStream(), setStopStatus(), and StopListItem().

CString ClientListItem::mUpdateName
protectedinherited

The documentation for this class was generated from the following files: