All pastes #2122929 Raw Edit

Stuff

public cpp v1 · immutable
#2122929 ·published 2012-02-29 16:28 UTC
rendered paste body
// tp-qt codeclass BaseProtocol : public QObject{public:	BaseProtocol(...)	// Proto properties	// should fail if we already expose this interface	bool plugInterface(const BaseProtocolInterfacePtr protoInterface);	QList<BaseProtocolInterfacePtr> pluggedInterfaces() const;protected SLOTS:	// Proto "virtual" methods;};class BaseProtocolInterface{	// maybe we find something to add here};class BaseProtocolPresence : public BaseProtocolInterface{ṕublic:	BaseProtocolPresence();	BaseProtocolPresence(const PresenceSpecList &statuses);	PresenceSpecList &statuses() const;	// no set method as this property is immutable	// no protected slot as the interface has no methods};// CM codeclass MyProtocol : public BaseProtocol{	MyProtocol(...)	{		PresenceSpecList statuses = myStatuses();		plugInterface(BaseProtocolInterfacePtr(new BaseProtocolPresence(statuses));	}	// reimplement "virtual" methods};int main(...){	...	MyCM cm = MyCM::create();	cm->addProtocol(MyProtocol::create());	cm->registerObject();}