/ src / libnml / nml / nml_oi.hh
nml_oi.hh
 1  /********************************************************************
 2  * Description: nml_oi.cc
 3  *   Defines Generic NML Message structures used to log errors and
 4  *   interact with an Operator Interface from within an NML_MODULE.
 5  *
 6  *   Derived from a work by Fred Proctor & Will Shackleford
 7  *
 8  * Author:
 9  * License: LGPL Version 2
10  * System: Linux
11  *    
12  * Copyright (c) 2004 All rights reserved.
13  *
14  * Last change: 
15  ********************************************************************/
16  
17  #ifndef NML_OI_HH
18  #define NML_OI_HH
19  
20  #include "cms.hh"		// class CMS
21  #include "nml.hh"		// class NML
22  #include "nmlmsg.hh"		// class NMLmsg
23  
24  // NML operator interface stuff for errors, text, and graphics display
25  
26  #define NML_ERROR_TYPE    ((NMLTYPE) 1)
27  #define NML_TEXT_TYPE     ((NMLTYPE) 2)
28  #define NML_DISPLAY_TYPE  ((NMLTYPE) 3)
29  
30  // Sizes for strings for the above messages
31  
32  #define NML_ERROR_LEN 256
33  #define NML_TEXT_LEN 256
34  #define NML_DISPLAY_LEN 256
35  
36  class NML_ERROR:public NMLmsg {
37    public:
38      NML_ERROR():NMLmsg(NML_ERROR_TYPE, sizeof(NML_ERROR)) {
39      };
40      ~NML_ERROR() {
41      };
42  
43      void update(CMS * cms);
44      char error[NML_ERROR_LEN];
45  };
46  
47  class NML_TEXT:public NMLmsg {
48    public:
49      NML_TEXT():NMLmsg(NML_TEXT_TYPE, sizeof(NML_TEXT)) {
50      };
51      ~NML_TEXT() {
52      };
53  
54      void update(CMS * cms);
55      char text[NML_TEXT_LEN];
56  };
57  
58  class NML_DISPLAY:public NMLmsg {
59    public:
60      NML_DISPLAY():NMLmsg(NML_DISPLAY_TYPE, sizeof(NML_DISPLAY)) {
61      };
62      ~NML_DISPLAY() {
63      };
64  
65      void update(CMS * cms);
66      char display[NML_DISPLAY_LEN];
67  };
68  
69  // NML format function
70  extern int nmlErrorFormat(NMLTYPE type, void *buffer, CMS * cms);
71  
72  #endif