Garmin Fleet Management Controller  2.19.0
WaypointListItem Class Reference

Tracks a waypoint that has been sent to the client. More...

#include <WaypointListItem.h>

+ Inheritance diagram for WaypointListItem:

Public Types

typedef uint32 key_type
 

Public Member Functions

 WaypointListItem ()
 Constructor. More...
 
void commitName ()
 Commit the item name. More...
 
uint16 getCategories () const
 Get categories that this waypoint is part of. 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 setCategories (uint16 val)
 Set the waypoint's categories. More...
 
void setId (const key_type &aId)
 Set item's ID. More...
 
void setParent (FileBackedMap< WaypointListItem > *aParent)
 Set the parent. 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

uint16 mCategories
 The categories that this waypoint is part of. (bit mapped) More...
 
FileBackedMap< WaypointListItem > * mParent
 The map that this item belongs to, or NULL if none. More...
 

Detailed Description

Tracks a waypoint that has been sent to the client.

Since
Protocol A607

Definition at line 19 of file WaypointListItem.h.

Member Typedef Documentation

Definition at line 22 of file WaypointListItem.h.

Constructor & Destructor Documentation

WaypointListItem::WaypointListItem ( )

Constructor.

Definition at line 16 of file WaypointListItem.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().

uint16 WaypointListItem::getCategories ( ) const

Get categories that this waypoint is part of.

Returns
The categories that this waypoint is part of

Definition at line 25 of file WaypointListItem.cpp.

References mCategories, and readFromStream().

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 ClientListItem::key_type & ClientListItem::getId ( ) const
inherited

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

Referenced by 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 WaypointListItem::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 from ClientListItem.

Definition at line 31 of file WaypointListItem.cpp.

References mCategories, ClientListItem::readFromStream(), and setCategories().

Referenced by getCategories().

void WaypointListItem::save ( )
protectedvirtual

Save this item.

Invokes parent to save all items

Reimplemented from ClientListItem.

Definition at line 78 of file WaypointListItem.cpp.

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

void WaypointListItem::setCategories ( uint16  aCategories)

Set the waypoint's categories.

Parameters
aCategoriesThe categories that this waypoint is part of

Definition at line 46 of file WaypointListItem.cpp.

References mCategories, and setParent().

Referenced by readFromStream(), and FmiApplicationLayer::sendWaypoint().

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

Set the parent.

Parameters
aParentThe FileBackedMap that contains this item

Definition at line 58 of file WaypointListItem.cpp.

References mParent, and writeToStream().

Referenced by setCategories().

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 WaypointListItem::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 from ClientListItem.

Definition at line 66 of file WaypointListItem.cpp.

References mCategories, and ClientListItem::writeToStream().

Referenced by setParent().

Member Data Documentation

uint16 WaypointListItem::mCategories
private

The categories that this waypoint is part of. (bit mapped)

Definition at line 53 of file WaypointListItem.h.

Referenced by getCategories(), readFromStream(), setCategories(), and writeToStream().

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

FileBackedMap<WaypointListItem>* WaypointListItem::mParent
private

The map that this item belongs to, or NULL if none.

Definition at line 50 of file WaypointListItem.h.

Referenced by save(), and setParent().

CString ClientListItem::mUpdateName
protectedinherited

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