sl@0: // Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of the License "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // e32test\system\t_multin.h sl@0: // sl@0: // sl@0: sl@0: // #define __TRACE__ sl@0: sl@0: #include sl@0: sl@0: class MProducer sl@0: { sl@0: public: sl@0: virtual TPtrC Produce()=0; sl@0: }; sl@0: sl@0: class MConsumer sl@0: { sl@0: public: sl@0: virtual void Consume(const TDesC& aStr)=0; sl@0: virtual void Consume(const TDesC& aStr1,const TDesC& aStr2); sl@0: virtual void Consume(const TDesC& aStr1,const TDesC& aStr2,const TDesC& aStr3); sl@0: virtual void Consume(const TDesC& aStr1,const TDesC& aStr2,const TDesC& aStr3,const TDesC& aStr4); sl@0: }; sl@0: sl@0: class MPipe : public MProducer,public MConsumer sl@0: { sl@0: public: sl@0: TPtrC Produce(); sl@0: void Consume(const TDesC& aStr); sl@0: void Consume(const TDesC& aStr1,const TDesC& aStr2); sl@0: void Consume(const TDesC& aStr1,const TDesC& aStr2,const TDesC& aStr3); sl@0: void Consume(const TDesC& aStr1,const TDesC& aStr2,const TDesC& aStr3,const TDesC& aStr4); sl@0: private: sl@0: TBuf<0x100> iBuf; sl@0: }; sl@0: sl@0: sl@0: enum TSpecies {EProducer,EConsumer,EPipe,EVirtual}; sl@0: sl@0: class TBase sl@0: { sl@0: public: sl@0: virtual ~TBase() {} sl@0: virtual TSpecies Species() const=0; sl@0: virtual MProducer* Producer(); sl@0: virtual MConsumer* Consumer(); sl@0: }; sl@0: sl@0: class TProducer : public TBase,public MProducer sl@0: { sl@0: public: sl@0: TSpecies Species() const; sl@0: TPtrC Produce(); sl@0: }; sl@0: sl@0: class TConsumer : public TBase,public MConsumer sl@0: { sl@0: public: sl@0: TSpecies Species() const; sl@0: void Consume(const TDesC& aStr); sl@0: }; sl@0: sl@0: class TPipe : public TBase,public MPipe sl@0: { sl@0: public: sl@0: TSpecies Species() const; sl@0: }; sl@0: sl@0: class TVirProducer : public virtual TBase,public MProducer sl@0: { sl@0: public: sl@0: ~TVirProducer() {} // gcc workaround sl@0: TSpecies Species() const; sl@0: MProducer* Producer(); sl@0: TPtrC Produce(); sl@0: }; sl@0: sl@0: class TVirConsumer : public virtual TBase,public MConsumer sl@0: { sl@0: public: sl@0: ~TVirConsumer() {} // gcc workaround sl@0: TSpecies Species() const; sl@0: MConsumer* Consumer(); sl@0: void Consume(const TDesC& aStr); sl@0: }; sl@0: sl@0: class TVirPipe : public TVirProducer,public TVirConsumer sl@0: { sl@0: public: sl@0: ~TVirPipe() {} // gcc workaround sl@0: TSpecies Species() const; sl@0: MProducer* Producer(); sl@0: MConsumer* Consumer(); sl@0: TPtrC Produce(); sl@0: void Consume(const TDesC& aStr); sl@0: void Consume(const TDesC& aStr1,const TDesC& aStr2); sl@0: void Consume(const TDesC& aStr1,const TDesC& aStr2,const TDesC& aStr3); sl@0: void Consume(const TDesC& aStr1,const TDesC& aStr2,const TDesC& aStr3,const TDesC& aStr4); sl@0: private: sl@0: TBuf<0x100> iBuf; sl@0: }; sl@0: