Add Freescale Nexus decoder implementation
[babeltrace.git] / converter / nexus / FullAddressVisitor.h
CommitLineData
9a2167bd
CB
1/*
2 * Copyright (C) 2013 Freescale Semiconductor, Inc.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a copy
5 * of this software and associated documentation files (the "Software"), to deal
6 * in the Software without restriction, including without limitation the rights
7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 * copies of the Software, and to permit persons to whom the Software is
9 * furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included
12 * in all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
20 * IN THE SOFTWARE.
21 */
22
23#ifndef FULLADDRESSVISITOR_h
24#define FULLADDRESSVISITOR_h
25
26#include <vector>
27#include <string>
28#include <map>
29#include "NxMessageVisitor.h"
30#include "SizedAddress.h"
31
32using std::vector;
33using std::string;
34using std::map;
35
36class NxDefaultMessage;
37class NxDebugStatusMessage;
38class NxDeviceIDMessage;
39class NxOwnershipTraceMessage;
40class NxDataAcquisitionMessage;
41class NxErrorMessage;
42class NxProgramTraceSync;
43class NxDataTraceWrite;
44class NxDataTraceRead;
45class NxDataTraceWriteSync;
46class NxDataTraceReadSync;
47class NxWatchpointMessage;
48class NxResourceFullMessage;
49class NxProgramTraceIndirectBranch;
50class NxProgramTraceIndirectBranchSync;
51class NxProgramTraceCorrelation;
52class NxDAMInCircuitTraceMessage;
53class NxCAMInCircuitTraceMessage;
54class NxCDMInCircuitTraceMessage;
55class NxDPQMInCircuitTraceMessage;
56class NxDPFMInCircuitTraceMessage;
57class NxCoreInCircuitTraceMessage;
58class NxInCircuitTraceMessage;
59class NxTimeStampCorrelation;
60
61
62// Keeps track of the Full Address as calculated from the
63// compressed addresses for the various components
64class FullAddressVisitor: public NxMessageVisitor
65{
66public:
67
68 FullAddressVisitor() : data_mismatch_(false)
69 {
70 }
71 virtual ~FullAddressVisitor()
72 {
73 }
74
75 virtual void visit(NxDefaultMessage *m){useful_visit_ = false;}
76 virtual void visit(NxDebugStatusMessage *m){useful_visit_ = false;}
77 virtual void visit(NxDeviceIDMessage *m){useful_visit_ = false;}
78 virtual void visit(NxOwnershipTraceMessage *m){useful_visit_ = false;}
79 virtual void visit(NxDataAcquisitionMessage *m){useful_visit_ = false;}
80 virtual void visit(NxErrorMessage *m){useful_visit_ = false;}
81 virtual void visit(NxDataTraceWrite *m){useful_visit_ = false;}
82 virtual void visit(NxDataTraceRead *m){useful_visit_ = false;}
83 virtual void visit(NxDataTraceWriteSync *m){useful_visit_ = false;}
84 virtual void visit(NxDataTraceReadSync *m){useful_visit_ = false;}
85 virtual void visit(NxWatchpointMessage *m){useful_visit_ = false;}
86 virtual void visit(NxResourceFullMessage *m){useful_visit_ = false;}
87 virtual void visit(NxProgramTraceCorrelation *m){useful_visit_ = false;}
88 virtual void visit(NxDPQMInCircuitTraceMessage *m){useful_visit_ = false;}
89 virtual void visit(NxDPFMInCircuitTraceMessage *m){useful_visit_ = false;}
90 virtual void visit(NxCoreInCircuitTraceMessage *m){useful_visit_ = false;}
91 virtual void visit(NxInCircuitTraceMessage *m){useful_visit_ = false;}
92 virtual void visit(NxTimeStampCorrelation *m){useful_visit_ = false;}
93
94 // implement the specific visit
95 virtual void visit(NxProgramTraceSync *m);
96
97 // implement the specific visit
98 virtual void visit(NxProgramTraceIndirectBranch *m);
99
100 // implement the specific visit
101 virtual void visit(NxProgramTraceIndirectBranchSync *m);
102
103 // implement the specific visit
104 virtual void visit(NxDAMInCircuitTraceMessage *m);
105
106 // implement the specific visit
107 virtual void visit(NxCDMInCircuitTraceMessage *m);
108
109 // implement the specific visit
110 virtual void visit(NxCAMInCircuitTraceMessage *m);
111
112 // output message information as a string
113 virtual string asString() const;
114
115private:
116
117 string last_key_;
118
119 // track addresses per source name
120 map <string, SizedAddress> source_addr_;
121
122 // address mismatch
123 mutable bool data_mismatch_;
124 SizedAddress mismatch_addr_;
125};
126
127#endif // FULLADDRESSVISITOR_h
This page took 0.026879 seconds and 4 git commands to generate.