1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/uloggeroutputplugin.h Wed Mar 31 12:33:34 2010 +0100
1.3 @@ -0,0 +1,95 @@
1.4 +// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +// ULogger output plug-in interface
1.18 +//
1.19 +//
1.20 +
1.21 +/**
1.22 + @file
1.23 + @publishedPartner
1.24 + @prototype
1.25 +*/
1.26 +
1.27 +#ifndef ULOGGEROUTPUTPLUGIN_H
1.28 +#define ULOGGEROUTPUTPLUGIN_H
1.29 +
1.30 +#include <e32base.h>
1.31 +#include "uloggerplugin.h"
1.32 +#include "uloggerdatatypes.h"
1.33 +
1.34 +namespace Ulogger
1.35 +{
1.36 +
1.37 +//! Abstract class for ULogger output plug-ins.
1.38 +/*!
1.39 +A ULogger output plug-in is responsible for writing Trace log data to some
1.40 +output medium. Examples for output media are files, serial ports or TCP sockets.
1.41 +Whenever ULogger needs to output Trace log data, it passes this to the currently
1.42 +selected output plug-in, which then handles the actual writing to an output
1.43 +medium.
1.44 +
1.45 +All output plug-ins must derive from this class in order to be compatible with
1.46 +ULogger. They must also derive from ULogger::CPlugin (whose header is already
1.47 +included by this header, for convenience) in order to be compatible with the
1.48 +ECom framework, which ULogger uses to load its output plug-ins.
1.49 +*/
1.50 +class MOutputPlugin
1.51 + {
1.52 +public:
1.53 + /**
1.54 + Writes the given data to the output media that is represented by the
1.55 + plug-in implementation. This method is called by ULogger whenever Trace log
1.56 + data becomes available. How much data is passed to this function depends
1.57 + on how ULogger is configured; the length of the given descriptor
1.58 + indicates the size of the data packet. The intervals at which
1.59 + this method is called depends on the amount of Trace data that is logged
1.60 + from code in the currently running processes.
1.61 +
1.62 + @param aData the Trace data to output, in BTrace format
1.63 + @return KErrNone, if successful; otherwise one of the other system wide
1.64 + error codes.
1.65 + */
1.66 + virtual TInt Write(const TDesC8& aData) = 0;
1.67 +
1.68 + /**
1.69 + Called by ULogger as first method after construction or after changes in
1.70 + config file. This allows the output plug-in to initialize itself with its
1.71 + private settings.
1.72 +
1.73 + @param aConfigs actual configurations valid for this instance
1.74 + @return KErrNone, if successful; otherwise one of the other system wide
1.75 + error codes.
1.76 + */
1.77 + virtual TInt ConfigureOutputPlugin(const RPointerArray<TPluginConfiguration>& aConfigs) = 0;
1.78 +
1.79 + /**
1.80 + Called by ULogger to indicate that the output plug-in must flush all buffers
1.81 + and release any locked resources. Any resources may be locked only after any
1.82 + other method is called.
1.83 + */
1.84 + virtual void CloseOutputPlugin() = 0;
1.85 +
1.86 + /** Virtual destructor. */
1.87 + virtual ~MOutputPlugin(){}
1.88 +
1.89 + /**
1.90 + Output plug-in interface id. This is for ULogger to distinguish between the
1.91 + different types of plug-ins (e.g. Output vs Input plug-ins).
1.92 + */
1.93 + static const CPlugin::TPluginInterface iInterfaceId = CPlugin::EOutput;
1.94 + };
1.95 +
1.96 +} //end of namespace
1.97 +
1.98 +#endif // ULOGGEROUTPUTPLUGIN_H