Garmin Fleet Management Controller  2.19.0
AobrdDriverItem Class Reference

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>

+ Inheritance diagram for AobrdDriverItem:

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_typegetId () 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< AobrdShipmentmShipments
 The shipments. More...
 
uint16 mTimeZone
 The driver time zone. More...
 

Detailed Description

Data structure to holds an AOBRD driver info. Used by the FmiApplicationLayer to validate logins when driver password support is enabled.

Since
Protocol A610

Definition at line 24 of file AobrdDriverItem.h.

Member Typedef Documentation

typedef std::string AobrdDriverItem::key_type

Definition at line 28 of file AobrdDriverItem.h.

Constructor & Destructor Documentation

AobrdDriverItem::AobrdDriverItem ( )

Constructor.

Definition at line 20 of file AobrdDriverItem.cpp.

AobrdDriverItem::~AobrdDriverItem ( )
virtual

Destructor.

Definition at line 34 of file AobrdDriverItem.cpp.

Member Function Documentation

void AobrdDriverItem::addShipment ( AobrdShipment shipment)

Add a shipment.

Adds a shipment to the list of shipments

Parameters
shipmentThe shipment to add

Definition at line 173 of file AobrdDriverItem.cpp.

References mShipments.

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().

void AobrdDriverItem::deleteShipment ( int  index)

Delete a shipment.

Removes a shipment from the list of shipments

Parameters
indexThe 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
CString AobrdDriverItem::getCarrierName ( ) const
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().

CString AobrdDriverItem::getDriverId ( ) const
CString AobrdDriverItem::getFirstName ( ) const
const AobrdDriverItem::key_type & AobrdDriverItem::getId ( ) const

Get item's ID.

Get the unique ID (driver ID) of this item

Returns
The item's ID

Definition at line 58 of file AobrdDriverItem.cpp.

References mDriverId.

CString AobrdDriverItem::getLastName ( ) const
uint16 AobrdDriverItem::getLoadTypeRuleset ( ) const

Get item's load type ruleset.

Get the load type ruleset of this item

Returns
The item's load type ruleset

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

Returns
The item's long term ruleset

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

Returns
The item's password

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

Returns
The item's shipments

Definition at line 163 of file AobrdDriverItem.cpp.

References mShipments.

Referenced by FmiApplicationLayer::rx(), and FmiApplicationLayer::sendNextAOBRDShipment().

uint16 AobrdDriverItem::getTimeZone ( ) const
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 AobrdDriverItem::readFromStream ( std::istream &  aStream)
virtual

Read a AobrdDriverItem from an input stream.

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

Parameters
aStreamThe 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

Parameters
shipmentThe new shipment
indexThe index of the existing shipment to replace

Definition at line 184 of file AobrdDriverItem.cpp.

References deleteShipment(), and mShipments.

void AobrdDriverItem::save ( )
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

Parameters
aCarrierIDThe 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

Parameters
aCarrierNameThe 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

Parameters
aFirstNameThe driver's first name

Definition at line 380 of file AobrdDriverItem.cpp.

References mFirstName, setLastName(), and ClientListItem::setValid().

Referenced by CAobrdDriversDlg::OnBnClickedSet(), and setPassword().

void ClientListItem::setId ( const key_type aId)
inherited
void AobrdDriverItem::setId ( const key_type aId)

Set the ID (key) of this item.

Sets the key associated with this item

Parameters
aIdThe 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

Parameters
aLastNameThe 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

Parameters
aRulesetThe 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

Parameters
aRulesetThe driver's long term ruleset

Definition at line 440 of file AobrdDriverItem.cpp.

References mLongTermRuleset, and ClientListItem::setValid().

Referenced by CAobrdDriversDlg::OnBnClickedSet(), and setCarrierID().

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 AobrdDriverItem::setParent ( FileBackedMap< AobrdDriverItem > *  aParent)

Set the parent map of this item.

Sets the map that this item is in

Parameters
aParentThe 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

Parameters
aPasswordThe 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

Parameters
aTimeZoneThe driver's time zone

Definition at line 482 of file AobrdDriverItem.cpp.

References mTimeZone, ClientListItem::setValid(), and writeToStream().

Referenced by CAobrdDriversDlg::OnBnClickedSet(), and setLoadTypeRuleset().

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 AobrdDriverItem::writeToStream ( std::ofstream &  aStream) const
virtual

Write a AobrdDriverItem to an output stream.

Append driver ID and password to the output stream.

Parameters
aStreamThe 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().

Member Data Documentation

std::string AobrdDriverItem::mCarrierID
private

The driver first name, UTF8 encoded.

Definition at line 87 of file AobrdDriverItem.h.

Referenced by getCarrierID(), readFromStream(), setCarrierID(), and writeToStream().

std::string AobrdDriverItem::mCarrierName
private

The driver carrier name, UTF8 encoded.

Definition at line 84 of file AobrdDriverItem.h.

Referenced by getCarrierName(), readFromStream(), setCarrierName(), and writeToStream().

CString ClientListItem::mCurrentName
protectedinherited
std::string AobrdDriverItem::mDriverId
private

The driver ID, UTF8 encoded.

Definition at line 72 of file AobrdDriverItem.h.

Referenced by getDriverId(), getId(), readFromStream(), setId(), and writeToStream().

std::string AobrdDriverItem::mDriverPassword
private

The driver password, UTF8 encoded.

Definition at line 75 of file AobrdDriverItem.h.

Referenced by getPassword(), readFromStream(), setPassword(), and writeToStream().

std::string AobrdDriverItem::mFirstName
private

The driver first name, UTF8 encoded.

Definition at line 78 of file AobrdDriverItem.h.

Referenced by getFirstName(), readFromStream(), setFirstName(), and writeToStream().

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().

BOOL ClientListItem::mIsValid
protectedinherited
std::string AobrdDriverItem::mLastName
private

The driver last name, UTF8 encoded.

Definition at line 81 of file AobrdDriverItem.h.

Referenced by getLastName(), readFromStream(), setLastName(), and writeToStream().

uint16 AobrdDriverItem::mLoadTypeRuleset
private

The driver load type ruleset.

Definition at line 94 of file AobrdDriverItem.h.

Referenced by getLoadTypeRuleset(), readFromStream(), setLoadTypeRuleset(), and writeToStream().

uint16 AobrdDriverItem::mLongTermRuleset
private

The driver long term ruleset.

Definition at line 90 of file AobrdDriverItem.h.

Referenced by getLongTermRuleset(), readFromStream(), setLongTermRuleset(), and writeToStream().

FileBackedMap<AobrdDriverItem>* AobrdDriverItem::mParent
private

The map that this DriverItem is a part of.

Definition at line 104 of file AobrdDriverItem.h.

Referenced by save(), and setParent().

std::vector<AobrdShipment> AobrdDriverItem::mShipments
private

The shipments.

Definition at line 101 of file AobrdDriverItem.h.

Referenced by addShipment(), deleteShipment(), getShipments(), readFromStream(), replaceShipment(), and writeToStream().

uint16 AobrdDriverItem::mTimeZone
private

The driver time zone.

Definition at line 98 of file AobrdDriverItem.h.

Referenced by getTimeZone(), readFromStream(), setTimeZone(), and writeToStream().

CString ClientListItem::mUpdateName
protectedinherited

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