Garmin Fleet Management Controller  2.19.0
SensorListItem Class Reference

Data structure to hold details of an A617 sensor that the server needs to keep. More...

#include <SensorListItem.h>

+ Inheritance diagram for SensorListItem:

Public Types

typedef uint32 key_type
 

Public Member Functions

 SensorListItem ()
 Constructor. More...
 
void commitName ()
 Commit the item name. More...
 
CString getCurrentName () const
 Get the current name of this item. More...
 
const char * getDescription () const
 Get the description. More...
 
uint8 getDisplayIndex () const
 Get display index. More...
 
uint16 getIcon () const
 Get icon. More...
 
const key_typegetId () const
 Get item's ID. More...
 
const char * getName () const
 Get name. More...
 
uint32 getNumUpdates () const
 Get the number of updates submitted. More...
 
boolean getPlaySound () const
 Get the play sound setting. More...
 
boolean getRecordSensor () const
 Get the record sensor setting. More...
 
uint8 getSeverity () const
 Get the severity. More...
 
const char * getStatus () const
 Get the status. More...
 
uint32 getUniqueId () const
 Get the unique 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 setConfig (fmi_sensor_config_request aConfig)
 Set the sensor. More...
 
void setCurrentName (CString aName)
 Set the current name of the sensor. More...
 
void setDisplayIndex (uint8 index)
 Set dispolay index in the list. More...
 
void setId (const key_type &aId)
 Set item's ID. More...
 
void setParent (FileBackedMap< SensorListItem > *aParent)
 Set the parent. More...
 
void setParent (FileBackedMap< ClientListItem > *aParent)
 Set the parent. More...
 
void setUpdate (fmi_sensor_update_request mUpdate)
 Set the update. 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)
 
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 Member Functions

uint32 getChangeId () const
 Get the change id. More...
 

Private Attributes

fmi_sensor_config_request mConfig
 
FileBackedMap< SensorListItem > * mParent
 The map that this item belongs to, or NULL if none. More...
 
fmi_sensor_update_request mUpdate
 
uint32 numUpdates
 

Detailed Description

Data structure to hold details of an A617 sensor that the server needs to keep.

Since
Protocol A617

Definition at line 22 of file SensorListItem.h.

Member Typedef Documentation

Definition at line 28 of file SensorListItem.h.

Constructor & Destructor Documentation

SensorListItem::SensorListItem ( )

Constructor.

Definition at line 19 of file SensorListItem.cpp.

References numUpdates.

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

uint32 SensorListItem::getChangeId ( ) const
private

Get the change id.

Returns
the id of the sensor

Definition at line 204 of file SensorListItem.cpp.

References fmi_sensor_config_request::change_id, and mConfig.

Referenced by writeToStream().

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 char * SensorListItem::getDescription ( ) const

Get the description.

Returns
the description of the last update

Definition at line 285 of file SensorListItem.cpp.

References fmi_sensor_update_request::description, mUpdate, and setConfig().

Referenced by CSendSensorDlg::RefreshList(), and writeToStream().

uint8 SensorListItem::getDisplayIndex ( ) const

Get display index.

Returns
the display index of the sensor

Definition at line 231 of file SensorListItem.cpp.

References fmi_sensor_config_request::display_index, and mConfig.

Referenced by CSendSensorDlg::RefreshList(), and writeToStream().

uint16 SensorListItem::getIcon ( ) const

Get icon.

Returns
the icon of the sensor

Definition at line 222 of file SensorListItem.cpp.

References fmi_sensor_config_request::icon, and mConfig.

Referenced by CSendSensorDlg::RefreshList(), and writeToStream().

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

const char * SensorListItem::getName ( ) const

Get name.

Returns
the name of the sensor

Definition at line 240 of file SensorListItem.cpp.

References mConfig, and fmi_sensor_config_request::name.

uint32 SensorListItem::getNumUpdates ( ) const

Get the number of updates submitted.

Returns
the numUpdates data

Definition at line 195 of file SensorListItem.cpp.

References numUpdates.

Referenced by CSendSensorDlg::RefreshList().

boolean SensorListItem::getPlaySound ( ) const

Get the play sound setting.

Returns
the play sound setting of the last update

Definition at line 258 of file SensorListItem.cpp.

References mUpdate, and fmi_sensor_update_request::play_sound.

Referenced by CSendSensorDlg::RefreshList(), and writeToStream().

boolean SensorListItem::getRecordSensor ( ) const

Get the record sensor setting.

Returns
the record sensor setting of the last update

Definition at line 267 of file SensorListItem.cpp.

References mUpdate, and fmi_sensor_update_request::record_sensor.

Referenced by CSendSensorDlg::RefreshList(), and writeToStream().

uint8 SensorListItem::getSeverity ( ) const

Get the severity.

Returns
the severity of the last update

Definition at line 249 of file SensorListItem.cpp.

References mUpdate, and fmi_sensor_update_request::severity.

Referenced by CSendSensorDlg::RefreshList().

const char * SensorListItem::getStatus ( ) const

Get the status.

Returns
the status of the last update

Definition at line 276 of file SensorListItem.cpp.

References mUpdate, and fmi_sensor_update_request::status.

Referenced by CSendSensorDlg::RefreshList(), and writeToStream().

uint32 SensorListItem::getUniqueId ( ) const

Get the unique id.

Returns
the unique id of the config alert popup

Definition at line 213 of file SensorListItem.cpp.

References mConfig, and fmi_sensor_config_request::unique_id.

Referenced by CSendSensorDlg::RefreshList(), and setUpdate().

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 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 SensorListItem::setConfig ( fmi_sensor_config_request  aConfig)

Set the sensor.

Parameters
aConfigThe config that serves as our sensor

Definition at line 295 of file SensorListItem.cpp.

References mConfig, and setUpdate().

Referenced by getDescription(), CSendSensorDlg::OnBnClickedCreate(), and readFromStream().

void SensorListItem::setCurrentName ( CString  aName)

Set the current name of the sensor.

Parameters
aNameThe new name of the sensor

Definition at line 335 of file SensorListItem.cpp.

References ClientListItem::mCurrentName, and setDisplayIndex().

Referenced by CSendSensorDlg::OnBnClickedCreate(), readFromStream(), and setParent().

void SensorListItem::setDisplayIndex ( uint8  index)

Set dispolay index in the list.

Parameters
index,thenew index

Definition at line 346 of file SensorListItem.cpp.

References fmi_sensor_config_request::display_index, and mConfig.

Referenced by setCurrentName().

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

Set the parent.

Parameters
aParentThe FileBackedMap that contains this item

Definition at line 323 of file SensorListItem.cpp.

References mParent, and setCurrentName().

Referenced by CSendSensorDlg::OnBnClickedCreate(), and setUpdate().

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 SensorListItem::setUpdate ( fmi_sensor_update_request  aUpdate)

Set the update.

Parameters
aUpdateThe update to this sensor

Definition at line 307 of file SensorListItem.cpp.

References getUniqueId(), mUpdate, numUpdates, setParent(), and fmi_sensor_update_request::unique_id.

Referenced by readFromStream(), and setConfig().

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

Member Data Documentation

fmi_sensor_config_request SensorListItem::mConfig
private
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<SensorListItem>* SensorListItem::mParent
private

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

Definition at line 95 of file SensorListItem.h.

Referenced by setParent().

fmi_sensor_update_request SensorListItem::mUpdate
private
CString ClientListItem::mUpdateName
protectedinherited
uint32 SensorListItem::numUpdates
private

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