OpenCSD - CoreSight Trace Decode Library  1.3.3
ocsd_dcd_tree_elem.h
Go to the documentation of this file.
1 
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 
50 typedef struct _decoder_elements
51 {
52  std::string dcd_name;
56  bool created;
58 
69 {
70 public:
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; };
81 };
82 
84 {
85  dcd_name = "unknown";
86  dcd_mngr = 0;
87  dcd_handle = 0;
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;
98  if(dcd_mngr)
100  created = bCreated;
101 }
102 
104 {
105  if(created && (dcd_mngr != 0) && (dcd_handle != 0))
107 }
108 
110 #endif // ARM_OCSD_DCD_TREE_ELEM_H_INCLUDED
111 
112 /* End of File ocsd_dcd_tree_elem.h */
Decode tree element.
ocsd_trace_protocol_t getProtocol() const
const std::string & getDecoderTypeName()
IDecoderMngr * getDecoderMngr()
TraceComponent * getDecoderHandle()
virtual const ocsd_trace_protocol_t getProtocolType() const =0
Get the built in protocol type ID managed by this instance - extern for custom decoders.
virtual ocsd_err_t destroyDecoder(TraceComponent *pComponent)=0
Base class for all decode components in the library.
Definition: trc_component.h:57
void SetDecoderElement(const std::string &name, IDecoderMngr *dcdMngr, TraceComponent *pHandle, bool bCreated)
struct _decoder_elements decoder_element
enum _ocsd_trace_protocol_t ocsd_trace_protocol_t
@ OCSD_PROTOCOL_UNKNOWN
@ OCSD_PROTOCOL_END
Decode tree element base structure.
IDecoderMngr * dcd_mngr
pointer to the decoder manager interface for the decodcer
TraceComponent * dcd_handle
handle to the decoder object
ocsd_trace_protocol_t protocol
protocol type
std::string dcd_name
Registered name of the decoder.
OpenCSD : Base trace decode component.