OpenCSD - CoreSight Trace Decode Library
1.8.3
Toggle main menu visibility
Loading...
Searching...
No Matches
include
common
ocsd_dcd_tree_elem.h
Go to the documentation of this file.
1
7
8
/*
9
* Redistribution and use in source and binary forms, with or without modification,
10
* are permitted provided that the following conditions are met:
11
*
12
* 1. Redistributions of source code must retain the above copyright notice,
13
* this list of conditions and the following disclaimer.
14
*
15
* 2. Redistributions in binary form must reproduce the above copyright notice,
16
* this list of conditions and the following disclaimer in the documentation
17
* and/or other materials provided with the distribution.
18
*
19
* 3. Neither the name of the copyright holder nor the names of its contributors
20
* may be used to endorse or promote products derived from this software without
21
* specific prior written permission.
22
*
23
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND
24
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
26
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
27
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33
*/
34
35
#ifndef ARM_OCSD_DCD_TREE_ELEM_H_INCLUDED
36
#define ARM_OCSD_DCD_TREE_ELEM_H_INCLUDED
37
38
#include "
common/ocsd_dcd_mngr_i.h
"
39
#include "
common/trc_component.h
"
40
43
50
typedef
struct
_decoder_elements
51
{
52
std::string
dcd_name
;
53
TraceComponent
*
dcd_handle
;
54
IDecoderMngr
*
dcd_mngr
;
55
ocsd_trace_protocol_t
protocol
;
56
bool
created
;
57
}
decoder_element
;
58
68
class
DecodeTreeElement
:
protected
decoder_element
69
{
70
public
:
71
DecodeTreeElement
();
72
~DecodeTreeElement
() {};
73
74
void
SetDecoderElement
(
const
std::string &name,
IDecoderMngr
*dcdMngr,
TraceComponent
*pHandle,
bool
bCreated);
75
void
DestroyElem
();
76
77
const
std::string &
getDecoderTypeName
() {
return
dcd_name
; };
78
IDecoderMngr
*
getDecoderMngr
() {
return
dcd_mngr
; };
79
ocsd_trace_protocol_t
getProtocol
()
const
{
return
protocol
; };
80
TraceComponent
*
getDecoderHandle
() {
return
dcd_handle
; };
81
};
82
83
inline
DecodeTreeElement::DecodeTreeElement
()
84
{
85
dcd_name
=
"unknown"
;
86
dcd_mngr
= 0;
87
dcd_handle
= 0;
88
protocol
=
OCSD_PROTOCOL_END
;
89
created
=
false
;
90
}
91
92
inline
void
DecodeTreeElement::SetDecoderElement
(
const
std::string &name,
IDecoderMngr
*dcdMngr,
TraceComponent
*pHandle,
bool
bCreated)
93
{
94
dcd_name
= name;
95
dcd_mngr
= dcdMngr;
96
dcd_handle
= pHandle;
97
protocol
=
OCSD_PROTOCOL_UNKNOWN
;
98
if
(
dcd_mngr
)
99
protocol
=
dcd_mngr
->getProtocolType();
100
created
= bCreated;
101
}
102
103
inline
void
DecodeTreeElement::DestroyElem
()
104
{
105
if
(
created
&& (
dcd_mngr
!= 0) && (
dcd_handle
!= 0))
106
dcd_mngr
->destroyDecoder(
dcd_handle
);
107
}
108
110
#endif
// ARM_OCSD_DCD_TREE_ELEM_H_INCLUDED
111
112
/* End of File ocsd_dcd_tree_elem.h */
DecodeTreeElement::getDecoderTypeName
const std::string & getDecoderTypeName()
Definition
ocsd_dcd_tree_elem.h:77
DecodeTreeElement::getProtocol
ocsd_trace_protocol_t getProtocol() const
Definition
ocsd_dcd_tree_elem.h:79
DecodeTreeElement::getDecoderMngr
IDecoderMngr * getDecoderMngr()
Definition
ocsd_dcd_tree_elem.h:78
DecodeTreeElement::getDecoderHandle
TraceComponent * getDecoderHandle()
Definition
ocsd_dcd_tree_elem.h:80
DecodeTreeElement::~DecodeTreeElement
~DecodeTreeElement()
Definition
ocsd_dcd_tree_elem.h:72
IDecoderMngr
Definition
ocsd_dcd_mngr_i.h:50
TraceComponent
Base class for all decode components in the library.
Definition
trc_component.h:57
DecodeTreeElement::DestroyElem
void DestroyElem()
Definition
ocsd_dcd_tree_elem.h:103
DecodeTreeElement::SetDecoderElement
void SetDecoderElement(const std::string &name, IDecoderMngr *dcdMngr, TraceComponent *pHandle, bool bCreated)
Definition
ocsd_dcd_tree_elem.h:92
decoder_element
struct _decoder_elements decoder_element
DecodeTreeElement::DecodeTreeElement
DecodeTreeElement()
Definition
ocsd_dcd_tree_elem.h:83
ocsd_trace_protocol_t
enum _ocsd_trace_protocol_t ocsd_trace_protocol_t
OCSD_PROTOCOL_UNKNOWN
@ OCSD_PROTOCOL_UNKNOWN
Definition
ocsd_if_types.h:574
OCSD_PROTOCOL_END
@ OCSD_PROTOCOL_END
Definition
ocsd_if_types.h:600
ocsd_dcd_mngr_i.h
_decoder_elements
Decode tree element base structure.
Definition
ocsd_dcd_tree_elem.h:51
_decoder_elements::dcd_mngr
IDecoderMngr * dcd_mngr
pointer to the decoder manager interface for the decodcer
Definition
ocsd_dcd_tree_elem.h:54
_decoder_elements::dcd_handle
TraceComponent * dcd_handle
handle to the decoder object
Definition
ocsd_dcd_tree_elem.h:53
_decoder_elements::protocol
ocsd_trace_protocol_t protocol
protocol type
Definition
ocsd_dcd_tree_elem.h:55
_decoder_elements::created
bool created
Definition
ocsd_dcd_tree_elem.h:56
_decoder_elements::dcd_name
std::string dcd_name
Registered name of the decoder.
Definition
ocsd_dcd_tree_elem.h:52
trc_component.h
OpenCSD : Base trace decode component.
Generated on
for OpenCSD - CoreSight Trace Decode Library by
1.17.0