Cat
var.h
Go to the documentation of this file.
1 // $Id: $
2 #ifndef INC_VAR_H
3 #define INC_VAR_H 1
4 
5 #include <vector>
6 #include <string>
7 
8 #include "MsgSvc.h"
9 
10 // Include files
11 
19 class var {
20 public:
21 
22  enum Type {
25  INT,
29  };
30 
32  var( );
33  var( char );
34  var( int );
35  var( float );
36  var( double );
37  var( std::string );
38  virtual ~var( );
39 
40  char vchar() { return m_char; }
41  int vint() { return m_int; }
42  float vfloat() { return m_float; }
43  double vdouble() { return m_double; }
44  std::string vstring() { return m_string; }
45 
46  std::vector<var> vector (const char*,...);
47 
48 protected:
49 
50 private:
51  char m_char;
52  int m_type ;
53  int m_int;
54  float m_float;
55  double m_double;
56  std::string m_string;
57 
59 
60  void verbose ( std::string msg ) { m_log.msgSvc (MsgSvc::VERBOSE , msg, std::string("var") ); }
61  void debug ( std::string msg ) { m_log.msgSvc (MsgSvc::DEBUG , msg, std::string("var") ); }
62  void info ( std::string msg ) { m_log.msgSvc (MsgSvc::INFO , msg, std::string("var") ); }
63  void warning ( std::string msg ) { m_log.msgSvc (MsgSvc::WARNING , msg, std::string("var") ); }
64  void fatal ( std::string msg ) { m_log.msgSvc (MsgSvc::FATAL , msg, std::string("var") ); }
65 
66  void verbose ( std::string msg , std::string name ) { m_log.msgSvc (MsgSvc::VERBOSE , msg, name ); }
67  void debug ( std::string msg , std::string name ) { m_log.msgSvc (MsgSvc::DEBUG , msg, name ); }
68  void info ( std::string msg , std::string name ) { m_log.msgSvc (MsgSvc::INFO , msg, name ); }
69  void warning ( std::string msg , std::string name ) { m_log.msgSvc (MsgSvc::WARNING , msg, name ); }
70  void fatal ( std::string msg , std::string name ) { m_log.msgSvc (MsgSvc::FATAL , msg, name ); }
71 };
72 
73 typedef std::vector<var> vars;
74 
75 #endif // INC_VAR_H
Definition: var.h:19
virtual ~var()
Destructor.
Definition: var.cpp:27
std::vector< var > vector(const char *,...)
Definition: var.cpp:74
MsgSvc m_log
Definition: var.h:58
char vchar()
Definition: var.h:40
Definition: var.h:25
void fatal(std::string msg)
Definition: var.h:64
int m_int
Definition: var.h:53
Type
Definition: var.h:22
void info(std::string msg)
Definition: var.h:62
void debug(std::string msg, std::string name)
Definition: var.h:67
float m_float
Definition: var.h:54
std::string m_string
Definition: var.h:56
double m_double
Definition: var.h:55
char m_char
Definition: var.h:51
void warning(std::string msg, std::string name)
Definition: var.h:69
float vfloat()
Definition: var.h:42
void debug(std::string msg)
Definition: var.h:61
void verbose(std::string msg)
Definition: var.h:60
Definition: var.h:24
double vdouble()
Definition: var.h:43
void warning(std::string msg)
Definition: var.h:63
int m_type
Definition: var.h:52
int vint()
Definition: var.h:41
std::vector< var > vars
Definition: var.h:73
void info(std::string msg, std::string name)
Definition: var.h:68
Definition: var.h:26
void fatal(std::string msg, std::string name)
Definition: var.h:70
void verbose(std::string msg, std::string name)
Definition: var.h:66
var()
Standard constructor.
Definition: var.cpp:21
std::string vstring()
Definition: var.h:44
Definition: MsgSvc.h:21
void msgSvc(MsgSvc::MsgLevel, std::string, std::string call=std::string(""))
Definition: MsgSvc.cpp:42