35 #ifndef ARM_OCSD_DCD_MNGR_H_INCLUDED 36 #define ARM_OCSD_DCD_MNGR_H_INCLUDED 38 #include "opencsd/ocsd_if_types.h" 44 template <
class P,
class Pt,
class Pc>
48 DecoderMngrBase(
const std::string &decoderTypeName, ocsd_trace_protocol_t builtInProtocol);
55 virtual const ocsd_trace_protocol_t
getProtocolType()
const {
return m_builtInProtocol; }
83 ocsd_trace_protocol_t m_builtInProtocol;
86 template <
class P,
class Pt,
class Pc>
92 m_builtInProtocol = builtInProtocol;
95 template <
class P,
class Pt,
class Pc>
100 bool bUseInstID = (create_flags & OCSD_CREATE_FLG_INST_ID) != 0;
101 bool bDecoder = (create_flags & OCSD_CREATE_FLG_FULL_DECODER) != 0;
102 bool bUnConfigured = (pConfig == 0);
104 const Pc *pConf =
dynamic_cast< const Pc *
>(pConfig);
107 if((pConf == 0) && !bUnConfigured)
108 return OCSD_ERR_INVALID_PARAM_TYPE;
110 if((create_flags & (OCSD_CREATE_FLG_PACKET_PROC | OCSD_CREATE_FLG_FULL_DECODER)) == 0)
111 return OCSD_ERR_INVALID_PARAM_VAL;
121 return OCSD_ERR_INVALID_PARAM_TYPE;
126 *ppTrcComp = pkt_proc;
139 return OCSD_ERR_INVALID_PARAM_TYPE;
152 *ppTrcComp = pkt_dcd;
157 template <
class P,
class Pt,
class Pc>
166 template <
class P,
class Pt,
class Pc>
172 template <
class P,
class Pt,
class Pc>
175 ocsd_err_t err = OCSD_ERR_DCD_INTERFACE_UNUSED;
178 return OCSD_ERR_INVALID_PARAM_TYPE;
182 return OCSD_ERR_INVALID_PARAM_TYPE;
190 template <
class P,
class Pt,
class Pc>
193 ocsd_err_t err = OCSD_ERR_DCD_INTERFACE_UNUSED;
196 return OCSD_ERR_INVALID_PARAM_TYPE;
200 return OCSD_ERR_INVALID_PARAM_TYPE;
208 template <
class P,
class Pt,
class Pc>
211 ocsd_err_t err = OCSD_ERR_INVALID_PARAM_TYPE;
218 return OCSD_ERR_INVALID_PARAM_TYPE;
225 template <
class P,
class Pt,
class Pc>
235 return OCSD_ERR_INVALID_PARAM_TYPE;
242 template <
class P,
class Pt,
class Pc>
252 if(pPktProcBase == 0)
253 return OCSD_ERR_INVALID_PARAM_TYPE;
258 return OCSD_ERR_INVALID_PARAM_TYPE;
263 template <
class P,
class Pt,
class Pc>
273 if(pPktProcBase == 0)
274 return OCSD_ERR_INVALID_PARAM_TYPE;
279 return OCSD_ERR_INVALID_PARAM_TYPE;
284 template <
class P,
class Pt,
class Pc>
289 return OCSD_ERR_INVALID_PARAM_TYPE;
294 return OCSD_ERR_INVALID_PARAM_TYPE;
298 if(pPktProcBase == 0)
299 return OCSD_ERR_INVALID_PARAM_TYPE;
305 template <
class P,
class Pt,
class Pc>
311 *pConfigBase = pConfig;
337 pComp =
new (std::nothrow) PktProc(instID);
339 pComp =
new (std::nothrow) PktProc();
347 pComp =
new (std::nothrow)PktDcd(instID);
349 pComp =
new (std::nothrow)PktDcd();
355 return new (std::nothrow) Pc((PcSt *)pDataStruct);
380 pComp =
new (std::nothrow) PktProc(instID);
382 pComp =
new (std::nothrow) PktProc();
388 return new (std::nothrow) Pc((PcSt *)pDataStruct);
394 #endif // ARM_OCSD_DCD_MNGR_H_INCLUDED DecoderMngrBase(const std::string &decoderTypeName, ocsd_trace_protocol_t builtInProtocol)
DecodeMngrFullDcd(const std::string &name, ocsd_trace_protocol_t builtInProtocol)
virtual ocsd_err_t attachPktIndexer(TraceComponent *pComponent, ITrcTypedBase *pPktIndexer)
attach a packet indexer to pkt processor (solo pkt processor, or pkt processor part of pair) ...
Interface to target memory access.
Abstract base class to for interfaces templated types.
virtual ocsd_err_t attachPktSink(TraceComponent *pComponent, ITrcTypedBase *pPktDataInSink)
attach a packet data sink to pkt processor output (solo pkt processor only - instead of decoder when ...
DecodeMngrPktProc(const std::string &name, ocsd_trace_protocol_t builtInProtocol)
virtual ocsd_err_t replace_first(T *component)
virtual ~DecodeMngrFullDcd()
virtual TraceComponent * createPktProc(const bool useInstID, const int instID)
const ocsd_err_t registerDecoderTypeByName(const std::string &name, IDecoderMngr *p_decoder_fact)
register a decoder manager interface
static OcsdLibDcdRegister * getDecoderRegister()
virtual ocsd_err_t destroyDecoder(TraceComponent *p_component)
componentAttachPt< ITrcGenElemIn > * getTraceElemOutAttachPt()
Packet Processor base class. Provides common infrastructure and interconnections for packet processor...
Base class for all decode components in the library.
ocsd_err_t setProtocolConfig(const Pc *config)
Interface class to an instruction opcode decoder.
const bool getUsesMemAccess() const
TraceComponent * getAssocComponent()
virtual ocsd_err_t attachPktMonitor(TraceComponent *pComponent, ITrcTypedBase *pPktRawDataMon)
attach a raw packet monitor to pkt processor (solo pkt processor, or pkt processor part of pair) ...
Interface to either trace data frame deformatter or packet processor.
Interface for the input of generic trace elements.
virtual CSConfig * createConfig(const void *pDataStruct)
Templated interface class to index packet types.
virtual TraceComponent * createPktProc(const bool useInstID, const int instID)=0
virtual ~DecodeMngrPktProc()
const bool getUsesIDecode() const
virtual ocsd_err_t setProtocolConfig(const Pc *config)
< Set the protocol specific configuration for the decoder.
virtual ocsd_err_t createConfigFromDataStruct(CSConfig **pConfigBase, const void *pDataStruct)
OpenCSD : Trace Packet decoder base class.
componentAttachPt< IPktRawDataMon< P > > * getRawPacketMonAttachPt()
Attachment point for the protocol packet monitor.
componentAttachPt< IInstrDecode > * getInstrDecodeAttachPt()
componentAttachPt< IPktDataIn< P > > * getPacketOutAttachPt()
Attachement point for the protocol packet output.
virtual ocsd_err_t getDataInputI(TraceComponent *pComponent, ITrcDataIn **ppDataIn)
get raw data input interface from packet processor
virtual ocsd_err_t attachErrorLogger(TraceComponent *pComponent, ITraceErrorLog *pIErrorLog)
attach error logger to ptk-processor, or both of pkt processor and pkt decoder pair ...
Base class for configuration data on CoreSight trace component.
virtual ocsd_err_t attachInstrDecoder(TraceComponent *pComponent, IInstrDecode *pIInstrDec)
attach instruction decoder to pkt decoder
Base Packet processing interface.
virtual const ocsd_trace_protocol_t getProtocolType() const
Get the built in protocol type ID managed by this instance - extern for custom decoders.
virtual ocsd_err_t attachMemAccessor(TraceComponent *pComponent, ITargetMemAccess *pMemAccessor)
attach memory accessor to pkt decoder
Error logging interface.This class provides a standard interface to the decoder error logger for all ...
virtual TraceComponent * createPktProc(const bool useInstID, const int instID)
virtual TraceComponent * createPktDecode(const bool useInstID, const int instID)
virtual ocsd_err_t attachOutputSink(TraceComponent *pComponent, ITrcGenElemIn *pOutSink)
attach generic output interface to pkt decoder
componentAttachPt< ITrcPktIndexer< Pt > > * getTraceIDIndexerAttachPt()
Attachment point for a packet indexer.
virtual ocsd_err_t createDecoder(const int create_flags, const int instID, const CSConfig *p_config, TraceComponent **p_component)
virtual CSConfig * createConfig(const void *pDataStruct)
Interface class providing an input for discrete protocol packets.
virtual TraceComponent * createPktDecode(const bool useInstID, const int instID)
void setAssocComponent(TraceComponent *assocComp)
virtual ocsd_err_t attach(T *component)
OpenCSD : Trace packet processor base class.
componentAttachPt< ITraceErrorLog > * getErrorLogAttachPt()
virtual CSConfig * createConfig(const void *pDataStruct)=0
componentAttachPt< ITargetMemAccess > * getMemoryAccessAttachPt()
Interface class for packet processor monitor.
virtual ~DecoderMngrBase()