Garmin Fleet Management Controller  2.19.0
ClientListItem Class Reference

Stores the name associated with a list item that is sent to the client. More...

#include <ClientListItem.h>

+ Inheritance diagram for ClientListItem:

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

Detailed Description

Stores the name associated with a list item that is sent to the client.

Since
Protocol A602

Definition at line 25 of file ClientListItem.h.

Member Typedef Documentation

key type

Definition at line 29 of file ClientListItem.h.

Constructor & Destructor Documentation

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.

Member Function Documentation

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.

Returns
The current (committed) name

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

Returns
The item's ID

Definition at line 49 of file ClientListItem.cpp.

References mId.

Referenced by FmiApplicationLayer::rx().

BOOL ClientListItem::isValid ( ) const

Check whether this item is valid.

Returns
TRUE if the item is valid, FALSE otherwise

Definition at line 58 of file ClientListItem.cpp.

References mIsValid, and readFromStream().

Referenced by CFileTransferDlg::AddPSRtoStopList(), CAobrdDriversDlg::OnBnClickedSet(), FmiApplicationLayer::procDriverStatusUpdate(), and FmiApplicationLayer::rx().

void ClientListItem::readFromStream ( std::istream &  aStream)
virtual

Read a ClientListItem from an input stream.

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

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

void ClientListItem::save ( )
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)
void ClientListItem::setParent ( FileBackedMap< ClientListItem > *  aParent)

Set the parent.

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

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

Write a ClientListItem to an output stream.

Append id and current name to the output stream.

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

Member Data Documentation

CString ClientListItem::mCurrentName
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().

key_type ClientListItem::mId
protected

The unique ID of this item.

Definition at line 84 of file ClientListItem.h.

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

BOOL ClientListItem::mIsValid
protected
FileBackedMap<ClientListItem>* ClientListItem::mParent
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().

CString ClientListItem::mUpdateName
protected

The last name entered by the user.

Definition at line 78 of file ClientListItem.h.

Referenced by ClientListItem(), commitName(), readFromStream(), and setUpdateName().


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