fork of ReportDB customized and renamed as a trivial support personnel database

Fork of ReportDB by Doug Anson

Committer:
ansond
Date:
Thu Oct 09 04:03:14 2014 +0000
Revision:
4:90df92778e77
Parent:
ReportDB.h@3:ea6ac7464011
updates including name change to support personnel

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ansond 3:ea6ac7464011 1 /* Copyright C2014 ARM, MIT License
ansond 3:ea6ac7464011 2 *
ansond 3:ea6ac7464011 3 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
ansond 3:ea6ac7464011 4 * and associated documentation files the "Software", to deal in the Software without restriction,
ansond 3:ea6ac7464011 5 * including without limitation the rights to use, copy, modify, merge, publish, distribute,
ansond 3:ea6ac7464011 6 * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
ansond 3:ea6ac7464011 7 * furnished to do so, subject to the following conditions:
ansond 3:ea6ac7464011 8 *
ansond 3:ea6ac7464011 9 * The above copyright notice and this permission notice shall be included in all copies or
ansond 3:ea6ac7464011 10 * substantial portions of the Software.
ansond 3:ea6ac7464011 11 *
ansond 3:ea6ac7464011 12 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
ansond 3:ea6ac7464011 13 * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
ansond 3:ea6ac7464011 14 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
ansond 3:ea6ac7464011 15 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
ansond 3:ea6ac7464011 16 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
ansond 3:ea6ac7464011 17 */
ansond 3:ea6ac7464011 18
ansond 4:90df92778e77 19 #ifndef _SUPPORT_PERSONNEL_DB_H_
ansond 4:90df92778e77 20 #define _SUPPORT_PERSONNEL_DB_H_
ansond 3:ea6ac7464011 21
ansond 3:ea6ac7464011 22 #include "Definitions.h"
ansond 3:ea6ac7464011 23
ansond 4:90df92778e77 24 // trivial support personal db entry...
ansond 3:ea6ac7464011 25 typedef struct {
ansond 3:ea6ac7464011 26 int rfid;
ansond 3:ea6ac7464011 27 char name[DB_MAX_NAME_LENGTH+1];
ansond 3:ea6ac7464011 28 char description[DB_MAX_DESCRIPTION_LENGTH+1];
ansond 4:90df92778e77 29 char status[DB_MAX_STATUS_LENGTH+1];
ansond 3:ea6ac7464011 30 char latitude[DB_MAX_LATLONG_LENGTH+1];
ansond 3:ea6ac7464011 31 char longitude[DB_MAX_LATLONG_LENGTH+1];
ansond 3:ea6ac7464011 32
ansond 4:90df92778e77 33 } SupportPersonEntry;
ansond 3:ea6ac7464011 34
ansond 4:90df92778e77 35 // trivial database of support personnel who can generate cases
ansond 4:90df92778e77 36 class SupportPersonnelDB {
ansond 3:ea6ac7464011 37 private:
ansond 4:90df92778e77 38 SupportPersonEntry m_db[DB_MAX_NUM_SUPPORT_PERSONS];
ansond 3:ea6ac7464011 39
ansond 3:ea6ac7464011 40 public:
ansond 4:90df92778e77 41 SupportPersonnelDB();
ansond 4:90df92778e77 42 virtual ~SupportPersonnelDB();
ansond 3:ea6ac7464011 43
ansond 4:90df92778e77 44 char *lookupName(int rfid);
ansond 4:90df92778e77 45 char *lookupDescription(int rfid);
ansond 4:90df92778e77 46 char *lookupStatus(int rfid);
ansond 4:90df92778e77 47 char *lookupLocationLatitude(int rfid);
ansond 4:90df92778e77 48 char *lookupLocationLongitude(int rfid);
ansond 3:ea6ac7464011 49
ansond 3:ea6ac7464011 50 private:
ansond 3:ea6ac7464011 51 void initDB();
ansond 4:90df92778e77 52 SupportPersonEntry *lookup(int rfid);
ansond 3:ea6ac7464011 53 };
ansond 3:ea6ac7464011 54
ansond 4:90df92778e77 55 #endif // _SUPPORT_PERSONNEL_DB_H_