diff -r 000000000000 -r 3553901f7fa8 telephonyserverplugins/simtsy/src/CSimPubSub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/telephonyserverplugins/simtsy/src/CSimPubSub.cpp Tue Feb 02 01:41:59 2010 +0200 @@ -0,0 +1,133 @@ +// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// Implements the CSimPubSub class +// +// + +#include "CSimPubSub.h" +#include "Simlog.h" + + +/** +Standard two phase construction. + +@param aPSSimObserver pointer to event observer +@param aUid uids of Publish&Subscribe uids to subscribe to. +*/ +CSimPubSub* CSimPubSub::NewL(MPSSimObserver* aPSSimObserver, const CSimPubSub::TPubSubProperty aProperty) + { + LOGSCOMMON1(">>CSimPubSub::NewL"); + CSimPubSub* pubsub=new(ELeave) CSimPubSub(aPSSimObserver,aProperty); + CleanupStack::PushL(pubsub); + pubsub->ConstructL(); + CleanupStack::Pop(); + LOGSCOMMON1("<SimPSEvent(iProperty,state); + } + } + } + +/** +Handles a request to cancel the state machine. +Cancels any P&S subscriptions. +*/ +void CSimPubSub::DoCancel() + { + iSubscribe.Cancel(); + } + +/** +Empty constructor +*/ +CSimPubSub::TPubSubProperty::TPubSubProperty() +{ +} + + +/** +Overloaded constructor +*/ +CSimPubSub::TPubSubProperty::TPubSubProperty(TUid aCategory, TInt aKey, TInt aType) +: iCategory(aCategory), iKey(aKey), iType(aType) +{ +} + + +/** +Compare for equality. +*/ +TBool CSimPubSub::TPubSubProperty::operator==(const CSimPubSub::TPubSubProperty& aProperty) const + { + return (iCategory == aProperty.iCategory && iKey == aProperty.iKey && iType == aProperty.iType); + }