Garmin Fleet Management Controller
2.19.0
|
Data structure to holds an allowed driver login (ID and password). Used by the FmiApplicationLayer to validate logins when driver password support is enabled. More...
#include <DriverLoginItem.h>
Public Types | |
typedef std::string | key_type |
Public Member Functions | |
DriverLoginItem () | |
Constructor. More... | |
virtual | ~DriverLoginItem () |
Destructor. More... | |
void | commitName () |
Commit the item name. More... | |
CString | getCurrentName () const |
Get the current name of this item. More... | |
CString | getDriverId () const |
Get the driver ID as a CString. More... | |
const key_type & | getId () const |
Get item's ID. More... | |
CString | getPassword () const |
Set the ID (key) of this item. More... | |
BOOL | isValid () const |
Check whether this item is valid. More... | |
void | readFromStream (std::istream &aStream) |
Read a DriverLoginItem from an input stream. More... | |
void | save () |
Save this item. More... | |
void | setId (const key_type &aId) |
Set the ID (key) of this item. More... | |
void | setParent (FileBackedMap< DriverLoginItem > *aParent) |
Set the parent map of this item. More... | |
void | setParent (FileBackedMap< ClientListItem > *aParent) |
Set the parent. More... | |
void | setPassword (const std::string &aPassword) |
Set the password of this driver. More... | |
void | setUpdateName (CString aName) |
Set pending name. More... | |
void | setValid (BOOL aValid=TRUE) |
Set this item as valid. More... | |
void | writeToStream (std::ofstream &aStream) const |
Write a DriverLoginItem to an output stream. 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 | |
std::string | mDriverId |
The driver ID, UTF8 encoded. More... | |
std::string | mDriverPassword |
The driver password, UTF8 encoded. More... | |
FileBackedMap< DriverLoginItem > * | mParent |
The map that this DriverLoginItem is a part of. More... | |
Data structure to holds an allowed driver login (ID and password). Used by the FmiApplicationLayer to validate logins when driver password support is enabled.
Definition at line 21 of file DriverLoginItem.h.
typedef std::string DriverLoginItem::key_type |
Definition at line 25 of file DriverLoginItem.h.
DriverLoginItem::DriverLoginItem | ( | ) |
Constructor.
Definition at line 17 of file DriverLoginItem.cpp.
|
virtual |
Destructor.
Definition at line 26 of file DriverLoginItem.cpp.
|
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().
|
inherited |
Get the current name of this item.
Definition at line 39 of file ClientListItem.cpp.
References ClientListItem::mCurrentName.
Referenced by CDriverIdAndStatusDlg::OnLbnSelchangeStatuslist(), FmiApplicationLayer::procDriverStatusUpdate(), CSendSensorDlg::RefreshList(), and FmiApplicationLayer::rx().
CString DriverLoginItem::getDriverId | ( | ) | const |
Get the driver ID as a CString.
Definition at line 34 of file DriverLoginItem.cpp.
References mDriverId.
Referenced by CDriverLoginDlg::OnLbnSelchangeDriverList().
const DriverLoginItem::key_type & DriverLoginItem::getId | ( | ) | const |
Get item's ID.
Get the unique ID (driver ID) of this item
Definition at line 49 of file DriverLoginItem.cpp.
References mDriverId.
CString DriverLoginItem::getPassword | ( | ) | const |
Set the ID (key) of this item.
Sets the key associated with this item
Definition at line 58 of file DriverLoginItem.cpp.
References mDriverPassword, and readFromStream().
Referenced by CDriverLoginDlg::OnLbnSelchangeDriverList(), and FmiApplicationLayer::rx().
|
inherited |
Check whether this item is valid.
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().
|
virtual |
Read a DriverLoginItem from an input stream.
Read id and password from the input stream, and updates the member variables appropriately.
aStream | The stream to read from |
Reimplemented from ClientListItem.
Definition at line 75 of file DriverLoginItem.cpp.
References mDriverId, mDriverPassword, ClientListItem::mIsValid, and TRUE.
Referenced by getPassword().
|
virtual |
Save this item.
Invokes parent to save all items
Reimplemented from ClientListItem.
Definition at line 109 of file DriverLoginItem.cpp.
References mParent, FileBackedMap< T >::save(), and setId().
void DriverLoginItem::setId | ( | const key_type & | aId | ) |
Set the ID (key) of this item.
Sets the key associated with this item
aId | The item's ID |
Definition at line 123 of file DriverLoginItem.cpp.
References mDriverId, and setParent().
Referenced by save().
void DriverLoginItem::setParent | ( | FileBackedMap< DriverLoginItem > * | aParent | ) |
Set the parent map of this item.
Sets the map that this item is in
aParent | The item's parent |
Definition at line 136 of file DriverLoginItem.cpp.
References mParent, and setPassword().
Referenced by setId().
|
inherited |
Set the parent.
aParent | The FileBackedMap that contains this item |
Definition at line 113 of file ClientListItem.cpp.
References ClientListItem::mParent, and ClientListItem::setUpdateName().
Referenced by ClientListItem::setId().
void DriverLoginItem::setPassword | ( | const std::string & | aPassword | ) |
Set the password of this driver.
Sets the password for this driver login
aPassword | The driver's password |
Definition at line 149 of file DriverLoginItem.cpp.
References mDriverPassword, ClientListItem::setValid(), and writeToStream().
Referenced by CDriverLoginDlg::OnBnClickedSet(), and setParent().
|
inherited |
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 ClientListItem::mUpdateName, and ClientListItem::setValid().
Referenced by FmiApplicationLayer::sendCannedMessage(), FmiApplicationLayer::sendCannedResponse(), FmiApplicationLayer::sendCreateWaypointCat(), FmiApplicationLayer::sendDriverStatusListItem(), FmiApplicationLayer::sendWaypoint(), and ClientListItem::setParent().
|
inherited |
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 ClientListItem::mIsValid, ClientListItem::save(), and ClientListItem::writeToStream().
Referenced by CFileTransferDlg::AddPSRtoStopList(), CMapViewerDlg::addStopToCatalog(), ClientListItem::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(), setPassword(), AobrdDriverItem::setPassword(), AobrdDriverItem::setTimeZone(), and ClientListItem::setUpdateName().
|
virtual |
Write a DriverLoginItem to an output stream.
Append driver ID and password to the output stream.
aStream | The stream to write to |
Reimplemented from ClientListItem.
Definition at line 164 of file DriverLoginItem.cpp.
References mDriverId, and mDriverPassword.
Referenced by setPassword().
|
protectedinherited |
The last name acknowledged by the client.
Definition at line 75 of file ClientListItem.h.
Referenced by ClientListItem::ClientListItem(), ClientListItem::commitName(), ClientListItem::getCurrentName(), ClientListItem::readFromStream(), StopListItem::setCurrentName(), SensorListItem::setCurrentName(), and ClientListItem::writeToStream().
|
private |
The driver ID, UTF8 encoded.
Definition at line 45 of file DriverLoginItem.h.
Referenced by getDriverId(), getId(), readFromStream(), setId(), and writeToStream().
|
private |
The driver password, UTF8 encoded.
Definition at line 48 of file DriverLoginItem.h.
Referenced by getPassword(), readFromStream(), setPassword(), and writeToStream().
|
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().
|
protectedinherited |
True if this list item is mIsValid.
Definition at line 81 of file ClientListItem.h.
Referenced by ClientListItem::ClientListItem(), ClientListItem::isValid(), InboxListItem::readFromStream(), readFromStream(), ClientListItem::readFromStream(), AobrdDriverItem::readFromStream(), and ClientListItem::setValid().
|
private |
The map that this DriverLoginItem is a part of.
Definition at line 51 of file DriverLoginItem.h.
Referenced by save(), and setParent().
|
protectedinherited |
The last name entered by the user.
Definition at line 78 of file ClientListItem.h.
Referenced by ClientListItem::ClientListItem(), ClientListItem::commitName(), ClientListItem::readFromStream(), and ClientListItem::setUpdateName().