Garmin Fleet Management Controller  2.19.0
InboxListItem Class Reference

Inbox List Item. More...

#include <InboxListItem.h>

+ Inheritance diagram for InboxListItem:

Public Types

typedef MessageId key_type
 

Public Member Functions

void commitName ()
 Commit the item name. More...
 
CString getCurrentName () const
 Get the current name of this item. More...
 
const key_typegetId () const
 Get the ID associated with this item. More...
 
BOOL isValid () const
 Check whether this item is valid. More...
 
void readFromStream (std::istream &aStream)
 Read an InboxListItem from an istream. More...
 
void setId (const key_type &aId)
 Set the ID associated with this item. More...
 
void setId (const key_type &aId)
 Set item's ID. More...
 
void setParent (FileBackedMap< InboxListItem > *aParent)
 Set the parent of this item. 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...
 
void writeToStream (std::ofstream &aStream)
 Write an InboxListItem to an output stream. 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

MessageId messageId
 
FileBackedMap< InboxListItem > * mParent
 

Detailed Description

Inbox List Item.

Definition at line 19 of file InboxListItem.h.

Member Typedef Documentation

Definition at line 22 of file InboxListItem.h.

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

const InboxListItem::key_type & InboxListItem::getId ( ) const

Get the ID associated with this item.

Returns
The item's ID

Definition at line 29 of file InboxListItem.cpp.

References messageId, and setParent().

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

Read an InboxListItem from an istream.

Parameters
aStreamThe stream to read from

Reimplemented from ClientListItem.

Definition at line 51 of file InboxListItem.cpp.

References messageId, ClientListItem::mIsValid, TRUE, and writeToStream().

Referenced by setParent().

void ClientListItem::save ( )
protectedvirtualinherited

Save this item.

Invokes parent to save all items

Reimplemented in AobrdDriverItem, WaypointListItem, and DriverLoginItem.

Definition at line 172 of file ClientListItem.cpp.

References ClientListItem::mParent, and FileBackedMap< T >::save().

Referenced by ClientListItem::setValid().

void InboxListItem::setId ( const key_type aId)

Set the ID associated with this item.

Parameters
aIdThe item's ID

Definition at line 18 of file InboxListItem.cpp.

void ClientListItem::setId ( const key_type aId)
inherited
void InboxListItem::setParent ( FileBackedMap< InboxListItem > *  aParent)

Set the parent of this item.

Parameters
aParentThe item's parent

Definition at line 39 of file InboxListItem.cpp.

References mParent, and readFromStream().

Referenced by getId().

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

Write an InboxListItem to an output stream.

Parameters
aStreamThe stream to write to

Definition at line 83 of file InboxListItem.cpp.

References MessageId::getId(), MessageId::getIdSize(), and messageId.

Referenced by readFromStream().

void ClientListItem::writeToStream ( std::ofstream &  aStream) const
virtualinherited

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 ClientListItem::mCurrentName, and ClientListItem::mId.

Referenced by ClientListItem::setValid(), WaypointListItem::writeToStream(), and SensorListItem::writeToStream().

Member Data Documentation

CString ClientListItem::mCurrentName
protectedinherited
MessageId InboxListItem::messageId
private

Definition at line 39 of file InboxListItem.h.

Referenced by getId(), readFromStream(), 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<InboxListItem>* InboxListItem::mParent
private

Definition at line 38 of file InboxListItem.h.

Referenced by setParent().

CString ClientListItem::mUpdateName
protectedinherited

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