versadac  1
versadac - Scalable Recorder Firmware
am_historybatchhdr.h
1 /*****************************************************************************
2 FILE : am_historybatchhdr.h
3 VERSION : $Id: am_historybatchhdr.h 4938 2006-10-10 14:20:18Z martinto $
4 AUTHOR : Sandra Herring
5 SYSTEM : GNU C++ for Power PC
6 DESCRIPTION : Header file for History Batch Header classes.
7 *****************************************************************************/
8 
9 #if !defined(__AM_HISTORYBATCHHDR_H)
10 #define __AM_HISTORYBATCHHDR_H
11 
12 #if !defined(__AM_HISTORYRECORD_H)
13 #include "am_historyrecord.h"
14 #endif
15 
16 #include <string.h>
17 
18 // ***************************************************************************
19 // Batch Header Record class
20 // ***************************************************************************
21 
23 {
24  public :
25 
26 /*------------------------------------------------------------------------------
27 FUNCTION : AM_HistoryBatchHeader constructor
28 DESCRIPTION :
29 ARGUMENTS : None.
30 RETURN : N/A
31 NOTES :
32 ------------------------------------------------------------------------------*/
34 
35 /*------------------------------------------------------------------------------
36 FUNCTION : AM_HistoryBatchHeader destructor
37 DESCRIPTION :
38 ARGUMENTS : None.
39 RETURN : N/A
40 NOTES :
41 ------------------------------------------------------------------------------*/
42  virtual ~AM_HistoryBatchHeader();
43 
44  // virtual services inherited from class AM_HistoryRecord, that must be supplied
45  // by derived type
46 
47  virtual sint32 read( AM_HistoryStream & stream );
48  virtual uint16 recordID();
49 
50  // non-virtual services
51 
52 /*------------------------------------------------------------------------------
53 FUNCTION : AM_HistoryBatchHeader getBatchName
54 DESCRIPTION : provides the batch name from the header (ie the first field data)
55 ARGUMENTS : None.
56 RETURN : batch name
57 NOTES :
58 ------------------------------------------------------------------------------*/
59  const char * getBatchName();
60 
61 /*------------------------------------------------------------------------------
62 FUNCTION : AM_HistoryBatchHeader::getStartTicks
63 DESCRIPTION : returns the batch start time in ticks relative to archive base year
64 ARGUMENTS : none.
65 RETURN : batch start time
66 NOTES :
67 ------------------------------------------------------------------------------*/
68  double getStartTicks();
69 
70  private:
71  double m_StartTicks; // start time of complete batch, in ticks relative to base year
72  char m_BatchName[61];
73 
74 }; // class AM_HistoryBatchHeader
75 
76 
77 // ****************************************
78 // inline services for class Batch Header
79 // ****************************************
80 
81 /*------------------------------------------------------------------------------
82 FUNCTION : AM_HistoryBatchHeader constructor
83 DESCRIPTION :
84 ARGUMENTS : None.
85 RETURN : N/A
86 NOTES :
87 ------------------------------------------------------------------------------*/
88 inline AM_HistoryBatchHeader::AM_HistoryBatchHeader()
89  : m_StartTicks(0.0)
90 {
91  *m_BatchName = '\0';
92 }
93 
94 /*------------------------------------------------------------------------------
95 FUNCTION : AM_HistoryBatchHeader destructor
96 DESCRIPTION :
97 ARGUMENTS : None.
98 RETURN : N/A
99 NOTES :
100 ------------------------------------------------------------------------------*/
101 inline AM_HistoryBatchHeader::~AM_HistoryBatchHeader()
102 {}
103 
104 /*------------------------------------------------------------------------------
105 FUNCTION : AM_HistoryBatchHeader getBatchName
106 DESCRIPTION : provides the batch name from the header (ie the first field data)
107 ARGUMENTS : None.
108 RETURN : batch name
109 NOTES :
110 ------------------------------------------------------------------------------*/
111 inline const char * AM_HistoryBatchHeader::getBatchName()
112 {
113  return m_BatchName;
114 }
115 
116 /*------------------------------------------------------------------------------
117 FUNCTION : AM_HistoryBatchHeader::getStartTicks
118 DESCRIPTION : returns the batch start time in ticks relative to archive base year
119 ARGUMENTS : none.
120 RETURN : batch start time
121 NOTES :
122 ------------------------------------------------------------------------------*/
123 inline double AM_HistoryBatchHeader::getStartTicks()
124 {
125  return m_StartTicks;
126 }
127 
128 #endif
Definition: am_historystream.h:23
Definition: am_historybatchhdr.h:22
Definition: am_historyrecord.h:29