1 /******************************************************************************
4 Lantiq Deutschland GmbH
6 For licensing information, see the file 'LICENSE' in the root folder of
9 ******************************************************************************/
22 #include "aux_utils.h"
26 friend istream
&operator>> (istream
&is
, CLogEvt
&evt
);
28 class exc_bad_evt_hdr
: public exc_basic
31 exc_bad_evt_hdr (uint32 info
) {
33 ss
<< "Incorrect LOG event header info:" << hex
<< showbase
<< setfill('0') << setw(8) << info
;
38 class exc_bad_data_type
: public exc_basic
41 exc_bad_data_type (uint8 dtype
) {
43 ss
<< "Unknown LOG event data type: " << dtype
;
50 virtual ~CLogEvt() {;}
52 string
GetSrcString(const CLogFmtDB
&fmt_db
) const;
53 string
GetDstString(const CLogFmtDB
&fmt_db
) const;
54 string
GetMsgString(const CLogFmtDB
&fmt_db
) const;
55 uint32
GetTS(void) const {
58 uint8
GetOID(void) const {
61 uint8
GetGID(void) const {
64 uint16
GetFID(void) const {
67 uint16
GetLID(void) const {
70 uint8
GetWLANIF(void) const {
73 bool HasData(void) const {
78 void Read(istream
&in_s
);
89 mutable vector
<int8
> m_buffer
;
92 istream
&operator>> (istream
&is
, CLogEvt
&evt
);
96 class exc_bad_format
: public exc_basic
99 exc_bad_format (string
&fmt
, size_t offs
, uint32 param
) {
101 ss
<< "Invalid format string= '" << fmt
<< "' offset=" << offs
<<" param=" << param
;
104 exc_bad_format (string
&fmt
, size_t offs
, const char *str
) {
106 ss
<< "Invalid format string= '" << fmt
<< "' offset=" << offs
<<" param='" << str
<< "'";
109 exc_bad_format (string
&fmt
, size_t offs
, const void *) {
111 ss
<< "Invalid format string= '" << fmt
<< "' offset=" << offs
<<" param is binary data";
116 CLogEvtFmt(const CLogEvt
&evt
)
118 , m_in_progress(false)
125 void BeginFormat(const CLogFmtDB
&fmt_db
);
127 void PutParam(const T
& val
);
128 void EndFormat(void);
130 string
&GetFormatResult(void) {
135 bool TryProcessOwnExtension(const string
& val_format
, const int8
&val
);
136 bool TryProcessOwnExtension(const string
& val_format
, const int32
&val
);
137 bool TryProcessOwnExtension(const string
& val_format
, const int64
&val
);
138 bool TryProcessOwnExtension(const string
& val_format
, const void *val
);
140 const CLogEvt
&m_evt
;
147 #endif // __LOGEVT_H__