Garmin Fleet Management Controller  2.19.0
DriverLoginItem Class Reference

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>

+ Inheritance diagram for DriverLoginItem:

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

Detailed Description

Data structure to holds an allowed driver login (ID and password). Used by the FmiApplicationLayer to validate logins when driver password support is enabled.

Since
Protocol A607

Definition at line 21 of file DriverLoginItem.h.

Member Typedef Documentation

typedef std::string DriverLoginItem::key_type

Definition at line 25 of file DriverLoginItem.h.

Constructor & Destructor Documentation

DriverLoginItem::DriverLoginItem ( )

Constructor.

Definition at line 17 of file DriverLoginItem.cpp.

DriverLoginItem::~DriverLoginItem ( )
virtual

Destructor.

Definition at line 26 of file DriverLoginItem.cpp.

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

CString DriverLoginItem::getDriverId ( ) const

Get the driver ID as a CString.

Returns
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

Returns
The item's ID

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

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 DriverLoginItem::readFromStream ( std::istream &  aStream)
virtual

Read a DriverLoginItem 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 75 of file DriverLoginItem.cpp.

References mDriverId, mDriverPassword, ClientListItem::mIsValid, and TRUE.

Referenced by getPassword().

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

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

Parameters
aParentThe item's parent

Definition at line 136 of file DriverLoginItem.cpp.

References mParent, and setPassword().

Referenced by setId().

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 DriverLoginItem::setPassword ( const std::string &  aPassword)

Set the password of this driver.

Sets the password for this driver login

Parameters
aPasswordThe driver's password

Definition at line 149 of file DriverLoginItem.cpp.

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

Referenced by CDriverLoginDlg::OnBnClickedSet(), and setParent().

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

Write a DriverLoginItem 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 164 of file DriverLoginItem.cpp.

References mDriverId, and mDriverPassword.

Referenced by setPassword().

Member Data Documentation

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

The driver ID, UTF8 encoded.

Definition at line 45 of file DriverLoginItem.h.

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

std::string DriverLoginItem::mDriverPassword
private

The driver password, UTF8 encoded.

Definition at line 48 of file DriverLoginItem.h.

Referenced by getPassword(), readFromStream(), setPassword(), 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
FileBackedMap<DriverLoginItem>* DriverLoginItem::mParent
private

The map that this DriverLoginItem is a part of.

Definition at line 51 of file DriverLoginItem.h.

Referenced by save(), and setParent().

CString ClientListItem::mUpdateName
protectedinherited

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