Garmin Fleet Management Controller
2.19.0
|
Stores the name associated with a list item that is sent to the client. More...
#include <ClientListItem.h>
Public Types | |
typedef uint32 | key_type |
key type More... | |
Public Member Functions | |
ClientListItem () | |
Constructor. More... | |
void | commitName () |
Commit the item name. More... | |
CString | getCurrentName () const |
Get the current name of this item. More... | |
const key_type & | getId () const |
Get item's ID. 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 | setId (const key_type &aId) |
Set item's ID. More... | |
void | setParent (FileBackedMap< ClientListItem > *aParent) |
Set the parent. 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< ClientListItem > * | mParent |
The map that this item belongs to, or NULL if none. More... | |
Stores the name associated with a list item that is sent to the client.
Definition at line 25 of file ClientListItem.h.
typedef uint32 ClientListItem::key_type |
key type
Definition at line 29 of file ClientListItem.h.
ClientListItem::ClientListItem | ( | ) |
Constructor.
Create a ClientListItem without a name or parent
Definition at line 17 of file ClientListItem.cpp.
References FALSE, mCurrentName, mIsValid, mParent, and mUpdateName.
void ClientListItem::commitName | ( | ) |
Commit the item name.
Commit the item name and set the ClientListItem as valid
Definition at line 29 of file ClientListItem.cpp.
References mCurrentName, mUpdateName, and setValid().
Referenced by FmiApplicationLayer::rx().
CString ClientListItem::getCurrentName | ( | ) | const |
Get the current name of this item.
Definition at line 39 of file ClientListItem.cpp.
References mCurrentName.
Referenced by CDriverIdAndStatusDlg::OnLbnSelchangeStatuslist(), FmiApplicationLayer::procDriverStatusUpdate(), CSendSensorDlg::RefreshList(), and FmiApplicationLayer::rx().
const ClientListItem::key_type & ClientListItem::getId | ( | ) | const |
Get item's ID.
Get the unique ID of this item
Definition at line 49 of file ClientListItem.cpp.
References mId.
Referenced by FmiApplicationLayer::rx().
BOOL ClientListItem::isValid | ( | ) | const |
Check whether this item is valid.
Definition at line 58 of file ClientListItem.cpp.
References mIsValid, and readFromStream().
Referenced by CFileTransferDlg::AddPSRtoStopList(), CAobrdDriversDlg::OnBnClickedSet(), FmiApplicationLayer::procDriverStatusUpdate(), and FmiApplicationLayer::rx().
|
virtual |
Read a ClientListItem from an input stream.
Read id and current name from the input stream, and updates the member variables appropriately.
aStream | The stream to read from |
Reimplemented in SensorListItem, AobrdDriverItem, DriverLoginItem, InboxListItem, StopListItem, and WaypointListItem.
Definition at line 70 of file ClientListItem.cpp.
References mCurrentName, mId, mIsValid, mUpdateName, setId(), and TRUE.
Referenced by isValid(), WaypointListItem::readFromStream(), and StopListItem::readFromStream().
|
protectedvirtual |
Save this item.
Invokes parent to save all items
Reimplemented in AobrdDriverItem, WaypointListItem, and DriverLoginItem.
Definition at line 172 of file ClientListItem.cpp.
References mParent, and FileBackedMap< T >::save().
Referenced by setValid().
void ClientListItem::setId | ( | const key_type & | aId | ) |
Set item's ID.
aId | The item's ID |
Definition at line 101 of file ClientListItem.cpp.
References mId, and setParent().
Referenced by CSendSensorDlg::OnBnClickedCreate(), CStopNewDlg::OnBnClickedOk(), readFromStream(), SensorListItem::readFromStream(), and FmiApplicationLayer::sendCannedMessage().
void ClientListItem::setParent | ( | FileBackedMap< ClientListItem > * | aParent | ) |
Set the parent.
aParent | The FileBackedMap that contains this item |
Definition at line 113 of file ClientListItem.cpp.
References mParent, and setUpdateName().
Referenced by setId().
void ClientListItem::setUpdateName | ( | CString | aName | ) |
Set pending name.
Set the pending name of this ClientListItem. This does not become the item's name until commitName is called.
aName | The pending name to set |
Definition at line 127 of file ClientListItem.cpp.
References mUpdateName, and setValid().
Referenced by FmiApplicationLayer::sendCannedMessage(), FmiApplicationLayer::sendCannedResponse(), FmiApplicationLayer::sendCreateWaypointCat(), FmiApplicationLayer::sendDriverStatusListItem(), FmiApplicationLayer::sendWaypoint(), and setParent().
void ClientListItem::setValid | ( | BOOL | aValid = TRUE | ) |
Set this item as valid.
Set the valid flag. If this item is part of a FileBackedMap, save the map.
aValid | If TRUE, the item is valid. |
Definition at line 141 of file ClientListItem.cpp.
References mIsValid, save(), and writeToStream().
Referenced by CFileTransferDlg::AddPSRtoStopList(), CMapViewerDlg::addStopToCatalog(), commitName(), CSendSensorDlg::OnBnClickedCreate(), CStopNewDlg::OnBnClickedOk(), SensorListItem::readFromStream(), FmiApplicationLayer::rx(), FmiApplicationLayer::sendA603Stop(), FmiApplicationLayer::sendDeleteWaypointCat(), CMapViewerDlg::sendRouteToDevice(), AobrdDriverItem::setCarrierID(), AobrdDriverItem::setCarrierName(), AobrdDriverItem::setFirstName(), AobrdDriverItem::setLastName(), AobrdDriverItem::setLoadTypeRuleset(), AobrdDriverItem::setLongTermRuleset(), DriverLoginItem::setPassword(), AobrdDriverItem::setPassword(), AobrdDriverItem::setTimeZone(), and setUpdateName().
|
virtual |
Write a ClientListItem to an output stream.
Append id and current name to the output stream.
aStream | The stream to write to |
Reimplemented in AobrdDriverItem, DriverLoginItem, and WaypointListItem.
Definition at line 155 of file ClientListItem.cpp.
References mCurrentName, and mId.
Referenced by setValid(), WaypointListItem::writeToStream(), and SensorListItem::writeToStream().
|
protected |
The last name acknowledged by the client.
Definition at line 75 of file ClientListItem.h.
Referenced by ClientListItem(), commitName(), getCurrentName(), readFromStream(), StopListItem::setCurrentName(), SensorListItem::setCurrentName(), and writeToStream().
|
protected |
The unique ID of this item.
Definition at line 84 of file ClientListItem.h.
Referenced by getId(), readFromStream(), setId(), and writeToStream().
|
protected |
True if this list item is mIsValid.
Definition at line 81 of file ClientListItem.h.
Referenced by ClientListItem(), isValid(), InboxListItem::readFromStream(), DriverLoginItem::readFromStream(), readFromStream(), AobrdDriverItem::readFromStream(), and setValid().
|
private |
The map that this item belongs to, or NULL if none.
Definition at line 87 of file ClientListItem.h.
Referenced by ClientListItem(), save(), and setParent().
|
protected |
The last name entered by the user.
Definition at line 78 of file ClientListItem.h.
Referenced by ClientListItem(), commitName(), readFromStream(), and setUpdateName().