Garmin Fleet Management Controller
2.19.0
|
Data structure to holds an AOBRD driver info. Used by the FmiApplicationLayer to validate logins when driver password support is enabled. More...
#include <AobrdDriverItem.h>
Public Types | |
typedef std::string | key_type |
Public Member Functions | |
AobrdDriverItem () | |
Constructor. More... | |
virtual | ~AobrdDriverItem () |
Destructor. More... | |
void | addShipment (AobrdShipment &shipment) |
Add a shipment. More... | |
void | commitName () |
Commit the item name. More... | |
void | deleteShipment (int index) |
Delete a shipment. More... | |
CString | getCarrierID () const |
Get item's carrier ID. More... | |
CString | getCarrierName () const |
Get item's carrier name. More... | |
CString | getCurrentName () const |
Get the current name of this item. More... | |
CString | getDriverId () const |
Get the driver ID as a CString. More... | |
CString | getFirstName () const |
Get item's first name. More... | |
const key_type & | getId () const |
Get item's ID. More... | |
CString | getLastName () const |
Get item's last name. More... | |
uint16 | getLoadTypeRuleset () const |
Get item's load type ruleset. More... | |
uint16 | getLongTermRuleset () const |
Get item's long term ruleset. More... | |
CString | getPassword () const |
Get item's password. More... | |
const std::vector< AobrdShipment > & | getShipments () const |
Get the list of shipments. More... | |
uint16 | getTimeZone () const |
Get item's time zone. More... | |
BOOL | isValid () const |
Check whether this item is valid. More... | |
void | readFromStream (std::istream &aStream) |
Read a AobrdDriverItem from an input stream. More... | |
void | replaceShipment (AobrdShipment &shipment, int index) |
Update a shipment. More... | |
void | save () |
Save this item. More... | |
void | setCarrierID (const std::string &aCarrierID) |
Set the carrier ID of this driver. More... | |
void | setCarrierName (const std::string &aCarrierName) |
Set the carrier name of this driver. More... | |
void | setFirstName (const std::string &aFirstName) |
Set the first name of this driver. More... | |
void | setId (const key_type &aId) |
Set item's ID. More... | |
void | setId (const key_type &aId) |
Set the ID (key) of this item. More... | |
void | setLastName (const std::string &aLastName) |
Set the last name of this driver. More... | |
void | setLoadTypeRuleset (const uint16 aRuleset) |
Set the load type ruleset of this driver. More... | |
void | setLongTermRuleset (const uint16 aRuleset) |
Set the long term ruleset of this driver. More... | |
void | setParent (FileBackedMap< ClientListItem > *aParent) |
Set the parent. More... | |
void | setParent (FileBackedMap< AobrdDriverItem > *aParent) |
Set the parent map of this item. More... | |
void | setPassword (const std::string &aPassword) |
Set the password of this driver. More... | |
void | setTimeZone (const uint16 aTimeZone) |
Set the time zone 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 AobrdDriverItem 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 | mCarrierID |
The driver first name, UTF8 encoded. More... | |
std::string | mCarrierName |
The driver carrier name, UTF8 encoded. More... | |
std::string | mDriverId |
The driver ID, UTF8 encoded. More... | |
std::string | mDriverPassword |
The driver password, UTF8 encoded. More... | |
std::string | mFirstName |
The driver first name, UTF8 encoded. More... | |
std::string | mLastName |
The driver last name, UTF8 encoded. More... | |
uint16 | mLoadTypeRuleset |
The driver load type ruleset. More... | |
uint16 | mLongTermRuleset |
The driver long term ruleset. More... | |
FileBackedMap< AobrdDriverItem > * | mParent |
The map that this DriverItem is a part of. More... | |
std::vector< AobrdShipment > | mShipments |
The shipments. More... | |
uint16 | mTimeZone |
The driver time zone. More... | |
Data structure to holds an AOBRD driver info. Used by the FmiApplicationLayer to validate logins when driver password support is enabled.
Definition at line 24 of file AobrdDriverItem.h.
typedef std::string AobrdDriverItem::key_type |
Definition at line 28 of file AobrdDriverItem.h.
AobrdDriverItem::AobrdDriverItem | ( | ) |
Constructor.
Definition at line 20 of file AobrdDriverItem.cpp.
|
virtual |
Destructor.
Definition at line 34 of file AobrdDriverItem.cpp.
void AobrdDriverItem::addShipment | ( | AobrdShipment & | shipment | ) |
Add a shipment.
Adds a shipment to the list of shipments
shipment | The shipment to add |
Definition at line 173 of file AobrdDriverItem.cpp.
References mShipments.
|
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().
void AobrdDriverItem::deleteShipment | ( | int | index | ) |
Delete a shipment.
Removes a shipment from the list of shipments
index | The index of the shipment to remove |
Definition at line 195 of file AobrdDriverItem.cpp.
References mShipments, and readFromStream().
Referenced by replaceShipment().
CString AobrdDriverItem::getCarrierID | ( | ) | const |
Get item's carrier ID.
Get the carrier ID of this item
Definition at line 128 of file AobrdDriverItem.cpp.
References mCarrierID.
Referenced by CAobrdDriversDlg::OnLbnSelchangeDriverList(), FmiApplicationLayer::rx(), FmiApplicationLayer::sendAOBRDDriverDownloadResponseV2(), FmiApplicationLayer::sendAOBRDDriverProfile(), and FmiApplicationLayer::sendAOBRDDriverProfileV2().
CString AobrdDriverItem::getCarrierName | ( | ) | const |
Get item's carrier name.
Get the carrier name of this item
Definition at line 113 of file AobrdDriverItem.cpp.
References mCarrierName.
Referenced by CAobrdDriversDlg::OnLbnSelchangeDriverList(), FmiApplicationLayer::rx(), FmiApplicationLayer::sendAOBRDDriverDownloadResponseV2(), FmiApplicationLayer::sendAOBRDDriverProfile(), and FmiApplicationLayer::sendAOBRDDriverProfileV2().
|
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 AobrdDriverItem::getDriverId | ( | ) | const |
Get the driver ID as a CString.
Definition at line 43 of file AobrdDriverItem.cpp.
References mDriverId.
Referenced by CAobrdDriversDlg::OnLbnSelchangeDriverList(), FmiApplicationLayer::sendAOBRDDriverDownloadResponseV2(), FmiApplicationLayer::sendAOBRDDriverLogoff(), FmiApplicationLayer::sendAOBRDDriverProfile(), and FmiApplicationLayer::sendAOBRDDriverProfileV2().
CString AobrdDriverItem::getFirstName | ( | ) | const |
Get item's first name.
Get the first name of this item
Definition at line 83 of file AobrdDriverItem.cpp.
References mFirstName.
Referenced by CAobrdDriversDlg::OnBnClickedSet(), CAobrdDriversDlg::OnLbnSelchangeDriverList(), FmiApplicationLayer::rx(), FmiApplicationLayer::sendAOBRDDriverDownloadResponseV2(), FmiApplicationLayer::sendAOBRDDriverProfile(), and FmiApplicationLayer::sendAOBRDDriverProfileV2().
const AobrdDriverItem::key_type & AobrdDriverItem::getId | ( | ) | const |
Get item's ID.
Get the unique ID (driver ID) of this item
Definition at line 58 of file AobrdDriverItem.cpp.
References mDriverId.
CString AobrdDriverItem::getLastName | ( | ) | const |
Get item's last name.
Get the last name of this item
Definition at line 98 of file AobrdDriverItem.cpp.
References mLastName.
Referenced by CAobrdDriversDlg::OnBnClickedSet(), CAobrdDriversDlg::OnLbnSelchangeDriverList(), FmiApplicationLayer::rx(), FmiApplicationLayer::sendAOBRDDriverDownloadResponseV2(), FmiApplicationLayer::sendAOBRDDriverProfile(), and FmiApplicationLayer::sendAOBRDDriverProfileV2().
uint16 AobrdDriverItem::getLoadTypeRuleset | ( | ) | const |
Get item's load type ruleset.
Get the load type ruleset of this item
Definition at line 455 of file AobrdDriverItem.cpp.
References mLoadTypeRuleset, and setLoadTypeRuleset().
Referenced by CAobrdDriversDlg::OnLbnSelchangeDriverList(), FmiApplicationLayer::sendAOBRDDriverDownloadResponseV2(), and FmiApplicationLayer::sendAOBRDDriverProfileV2().
uint16 AobrdDriverItem::getLongTermRuleset | ( | ) | const |
Get item's long term ruleset.
Get the long term ruleset of this item
Definition at line 143 of file AobrdDriverItem.cpp.
References mLongTermRuleset.
Referenced by CAobrdDriversDlg::OnLbnSelchangeDriverList(), FmiApplicationLayer::rx(), FmiApplicationLayer::sendAOBRDDriverDownloadResponseV2(), FmiApplicationLayer::sendAOBRDDriverProfile(), and FmiApplicationLayer::sendAOBRDDriverProfileV2().
CString AobrdDriverItem::getPassword | ( | ) | const |
Get item's password.
Get the password of this item
Definition at line 68 of file AobrdDriverItem.cpp.
References mDriverPassword.
Referenced by CAobrdDriversDlg::OnLbnSelchangeDriverList(), and FmiApplicationLayer::rx().
const std::vector< AobrdShipment > & AobrdDriverItem::getShipments | ( | ) | const |
Get the list of shipments.
Get the shipments for this item
Definition at line 163 of file AobrdDriverItem.cpp.
References mShipments.
Referenced by FmiApplicationLayer::rx(), and FmiApplicationLayer::sendNextAOBRDShipment().
uint16 AobrdDriverItem::getTimeZone | ( | ) | const |
Get item's time zone.
Get the time zone of this item
Definition at line 153 of file AobrdDriverItem.cpp.
References mTimeZone.
Referenced by CAobrdDriversDlg::OnLbnSelchangeDriverList(), FmiApplicationLayer::rx(), FmiApplicationLayer::sendAOBRDDriverDownloadResponseV2(), FmiApplicationLayer::sendAOBRDDriverProfile(), and FmiApplicationLayer::sendAOBRDDriverProfileV2().
|
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 AobrdDriverItem 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 207 of file AobrdDriverItem.cpp.
References mCarrierID, mCarrierName, mDriverId, mDriverPassword, mFirstName, ClientListItem::mIsValid, mLastName, mLoadTypeRuleset, mLongTermRuleset, mShipments, mTimeZone, AobrdShipment::readFromStream(), RECORD_SEPARATOR, and TRUE.
Referenced by deleteShipment().
void AobrdDriverItem::replaceShipment | ( | AobrdShipment & | shipment, |
int | index | ||
) |
Update a shipment.
Replaces a shipment at existing location with a new one
shipment | The new shipment |
index | The index of the existing shipment to replace |
Definition at line 184 of file AobrdDriverItem.cpp.
References deleteShipment(), and mShipments.
|
virtual |
Save this item.
Invokes parent to save all items
Reimplemented from ClientListItem.
Definition at line 325 of file AobrdDriverItem.cpp.
References mParent, FileBackedMap< T >::save(), and setId().
void AobrdDriverItem::setCarrierID | ( | const std::string & | aCarrierID | ) |
Set the carrier ID of this driver.
Sets the carrier ID for this driver
aCarrierID | The driver's carrier ID |
Definition at line 425 of file AobrdDriverItem.cpp.
References mCarrierID, setLongTermRuleset(), and ClientListItem::setValid().
Referenced by CAobrdDriversDlg::OnBnClickedSet(), and setCarrierName().
void AobrdDriverItem::setCarrierName | ( | const std::string & | aCarrierName | ) |
Set the carrier name of this driver.
Sets the carrier name for this driver
aCarrierName | The driver's carrier name |
Definition at line 410 of file AobrdDriverItem.cpp.
References mCarrierName, setCarrierID(), and ClientListItem::setValid().
Referenced by CAobrdDriversDlg::OnBnClickedSet(), and setLastName().
void AobrdDriverItem::setFirstName | ( | const std::string & | aFirstName | ) |
Set the first name of this driver.
Sets the first name for this driver
aFirstName | The driver's first name |
Definition at line 380 of file AobrdDriverItem.cpp.
References mFirstName, setLastName(), and ClientListItem::setValid().
Referenced by CAobrdDriversDlg::OnBnClickedSet(), and setPassword().
|
inherited |
Set item's ID.
aId | The item's ID |
Definition at line 101 of file ClientListItem.cpp.
References ClientListItem::mId, and ClientListItem::setParent().
Referenced by CSendSensorDlg::OnBnClickedCreate(), CStopNewDlg::OnBnClickedOk(), ClientListItem::readFromStream(), SensorListItem::readFromStream(), and FmiApplicationLayer::sendCannedMessage().
void AobrdDriverItem::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 339 of file AobrdDriverItem.cpp.
References mDriverId, and setParent().
Referenced by save().
void AobrdDriverItem::setLastName | ( | const std::string & | aLastName | ) |
Set the last name of this driver.
Sets the last name for this driver
aLastName | The driver's last name |
Definition at line 395 of file AobrdDriverItem.cpp.
References mLastName, setCarrierName(), and ClientListItem::setValid().
Referenced by CAobrdDriversDlg::OnBnClickedSet(), and setFirstName().
void AobrdDriverItem::setLoadTypeRuleset | ( | const uint16 | aRuleset | ) |
Set the load type ruleset of this driver.
Sets the load type ruleset for this driver
aRuleset | The driver's load type ruleset |
Definition at line 466 of file AobrdDriverItem.cpp.
References mLoadTypeRuleset, setTimeZone(), and ClientListItem::setValid().
Referenced by getLoadTypeRuleset(), and CAobrdDriversDlg::OnBnClickedSet().
void AobrdDriverItem::setLongTermRuleset | ( | const uint16 | aRuleset | ) |
Set the long term ruleset of this driver.
Sets the long term ruleset for this driver
aRuleset | The driver's long term ruleset |
Definition at line 440 of file AobrdDriverItem.cpp.
References mLongTermRuleset, and ClientListItem::setValid().
Referenced by CAobrdDriversDlg::OnBnClickedSet(), and setCarrierID().
|
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 AobrdDriverItem::setParent | ( | FileBackedMap< AobrdDriverItem > * | aParent | ) |
Set the parent map of this item.
Sets the map that this item is in
aParent | The item's parent |
Definition at line 352 of file AobrdDriverItem.cpp.
References mParent, and setPassword().
Referenced by setId().
void AobrdDriverItem::setPassword | ( | const std::string & | aPassword | ) |
Set the password of this driver.
Sets the password for this driver
aPassword | The driver's password |
Definition at line 365 of file AobrdDriverItem.cpp.
References mDriverPassword, setFirstName(), and ClientListItem::setValid().
Referenced by CAobrdDriversDlg::OnBnClickedSet(), and setParent().
void AobrdDriverItem::setTimeZone | ( | const uint16 | aTimeZone | ) |
Set the time zone of this driver.
Sets the time zone for this driver
aTimeZone | The driver's time zone |
Definition at line 482 of file AobrdDriverItem.cpp.
References mTimeZone, ClientListItem::setValid(), and writeToStream().
Referenced by CAobrdDriversDlg::OnBnClickedSet(), and setLoadTypeRuleset().
|
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(), setCarrierID(), setCarrierName(), setFirstName(), setLastName(), setLoadTypeRuleset(), setLongTermRuleset(), DriverLoginItem::setPassword(), setPassword(), setTimeZone(), and ClientListItem::setUpdateName().
|
virtual |
Write a AobrdDriverItem 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 497 of file AobrdDriverItem.cpp.
References CURRENT_VERSION, mCarrierID, mCarrierName, mDriverId, mDriverPassword, mFirstName, mLastName, mLoadTypeRuleset, mLongTermRuleset, mShipments, mTimeZone, RECORD_SEPARATOR, and AobrdShipment::writeToStream().
Referenced by setTimeZone().
|
private |
The driver first name, UTF8 encoded.
Definition at line 87 of file AobrdDriverItem.h.
Referenced by getCarrierID(), readFromStream(), setCarrierID(), and writeToStream().
|
private |
The driver carrier name, UTF8 encoded.
Definition at line 84 of file AobrdDriverItem.h.
Referenced by getCarrierName(), readFromStream(), setCarrierName(), and writeToStream().
|
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 72 of file AobrdDriverItem.h.
Referenced by getDriverId(), getId(), readFromStream(), setId(), and writeToStream().
|
private |
The driver password, UTF8 encoded.
Definition at line 75 of file AobrdDriverItem.h.
Referenced by getPassword(), readFromStream(), setPassword(), and writeToStream().
|
private |
The driver first name, UTF8 encoded.
Definition at line 78 of file AobrdDriverItem.h.
Referenced by getFirstName(), readFromStream(), setFirstName(), 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(), DriverLoginItem::readFromStream(), ClientListItem::readFromStream(), readFromStream(), and ClientListItem::setValid().
|
private |
The driver last name, UTF8 encoded.
Definition at line 81 of file AobrdDriverItem.h.
Referenced by getLastName(), readFromStream(), setLastName(), and writeToStream().
|
private |
The driver load type ruleset.
Definition at line 94 of file AobrdDriverItem.h.
Referenced by getLoadTypeRuleset(), readFromStream(), setLoadTypeRuleset(), and writeToStream().
|
private |
The driver long term ruleset.
Definition at line 90 of file AobrdDriverItem.h.
Referenced by getLongTermRuleset(), readFromStream(), setLongTermRuleset(), and writeToStream().
|
private |
The map that this DriverItem is a part of.
Definition at line 104 of file AobrdDriverItem.h.
Referenced by save(), and setParent().
|
private |
The shipments.
Definition at line 101 of file AobrdDriverItem.h.
Referenced by addShipment(), deleteShipment(), getShipments(), readFromStream(), replaceShipment(), and writeToStream().
|
private |
The driver time zone.
Definition at line 98 of file AobrdDriverItem.h.
Referenced by getTimeZone(), readFromStream(), setTimeZone(), and writeToStream().
|
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().