Garmin Fleet Management Controller  2.19.0
ClientListItem.h
Go to the documentation of this file.
1 /*********************************************************************
2 *
3 * HEADER NAME:
4 * ClientListItem.h
5 *
6 * Copyright 2008-2011 by Garmin Ltd. or its subsidiaries.
7 *---------------------------------------------------------------------
8 * $NoKeywords$
9 *********************************************************************/
10 #ifndef _CLIENTLISTITEM_H
11 #define _CLIENTLISTITEM_H
12 
13 #include "stdafx.h"
14 #include <map>
15 #include <fstream>
16 
17 class ClientListItem;
18 
19 #include "garmin_types.h"
20 #include "FileBackedMap.h"
21 
26 {
27 public:
29  typedef uint32 key_type;
30 
32 
33  void commitName();
34 
35  CString getCurrentName() const;
36 
37  const key_type & getId() const;
38 
39  BOOL isValid() const;
40 
41  virtual void readFromStream
42  (
43  std::istream &aStream
44  );
45 
46  void setId
47  (
48  const key_type & aId
49  );
50 
51  void setParent
52  (
54  );
55 
56  void setUpdateName
57  (
58  CString aName
59  );
60 
61  void setValid
62  (
63  BOOL aValid = TRUE
64  );
65 
66  virtual void writeToStream
67  (
68  std::ofstream &aStream
69  ) const;
70 
71 protected:
72  virtual void save();
73 
75  CString mCurrentName;
76 
78  CString mUpdateName;
79 
81  BOOL mIsValid;
82 
84  key_type mId;
85 private:
88 };
89 
90 #endif
BOOL isValid() const
Check whether this item is valid.
ClientListItem()
Constructor.
void setId(const key_type &aId)
Set item&#39;s ID.
virtual void readFromStream(std::istream &aStream)
Read a ClientListItem from an input stream.
virtual void save()
Save this item.
CString getCurrentName() const
Get the current name of this item.
CString mUpdateName
The last name entered by the user.
const key_type & getId() const
Get item&#39;s ID.
void commitName()
Commit the item name.
void setValid(BOOL aValid=TRUE)
Set this item as valid.
#define TRUE
Definition: garmin_types.h:45
virtual void writeToStream(std::ofstream &aStream) const
Write a ClientListItem to an output stream.
CString mCurrentName
The last name acknowledged by the client.
void setUpdateName(CString aName)
Set pending name.
uint32 key_type
key type
Stores the name associated with a list item that is sent to the client.
BOOL mIsValid
True if this list item is mIsValid.
void setParent(FileBackedMap< ClientListItem > *aParent)
Set the parent.
FileBackedMap< ClientListItem > * mParent
The map that this item belongs to, or NULL if none.
key_type mId
The unique ID of this item.
unsigned long int uint32
32-bit unsigned integer
Definition: garmin_types.h:66