equal
deleted
inserted
replaced
26 #include <elements/factory.h> |
26 #include <elements/factory.h> |
27 |
27 |
28 namespace Factories |
28 namespace Factories |
29 { |
29 { |
30 |
30 |
31 typedef void (*TInterfaceStateChangeFn)( TAny*, TDesC8& aInfo ); |
31 typedef void (*TInterfaceStateChangeFn)( TAny*, const TDesC8& aInfo ); |
32 typedef TInt (*TFactoryNotifyFn)( TAny*, AFactoryObject& aObject, CFactoryBase& aFactory ); |
32 typedef TInt (*TFactoryNotifyFn)( TAny*, AFactoryObject& aObject, CFactoryBase& aFactory ); |
33 typedef void (*TAnyFn)(TAny*); |
33 typedef void (*TAnyFn)(TAny*); |
34 |
34 |
35 //could be as a const static table part of the class |
35 //could be as a const static table part of the class |
36 class IFactoryNotify |
36 class IFactoryNotify |
48 iThis( aThis ), |
48 iThis( aThis ), |
49 iInterfaceVTable( &aInterfaceVTable ) |
49 iInterfaceVTable( &aInterfaceVTable ) |
50 { |
50 { |
51 } |
51 } |
52 |
52 |
53 void InterfaceStateChange(TDesC8& aInfo) |
53 void InterfaceStateChange(const TDesC8& aInfo) |
54 { |
54 { |
55 if ( Check(1) ) |
55 if ( Check(1) ) |
56 { |
56 { |
57 ((TInterfaceStateChangeFn)(iInterfaceVTable[1]))(iThis,aInfo); |
57 ((TInterfaceStateChangeFn)(iInterfaceVTable[1]))(iThis,aInfo); |
58 } |
58 } |
87 /** |
87 /** |
88 @internalComponent |
88 @internalComponent |
89 */ |
89 */ |
90 { |
90 { |
91 public: |
91 public: |
92 static void Notification(TAny* aThis, TDesC8& aInfo); |
92 static void Notification(TAny* aThis, const TDesC8& aInfo); |
93 static void NotifyDeletion(TAny* aThis, AFactoryObject& aObject, CFactoryBase& aFactory); |
93 static void NotifyDeletion(TAny* aThis, AFactoryObject& aObject, CFactoryBase& aFactory); |
94 static TInt NotifyCreation(TAny* aThis, AFactoryObject& aObject, CFactoryBase& aFactory); |
94 static TInt NotifyCreation(TAny* aThis, AFactoryObject& aObject, CFactoryBase& aFactory); |
95 |
95 |
96 }; |
96 }; |
97 |
97 |
98 template <class TCLIENT> |
98 template <class TCLIENT> |
99 void TFactoryNotify<TCLIENT>::Notification(TAny* aThis, TDesC8& aInfo) |
99 void TFactoryNotify<TCLIENT>::Notification(TAny* aThis, const TDesC8& aInfo) |
100 { |
100 { |
101 TCLIENT* me = (TCLIENT*)aThis; |
101 TCLIENT* me = (TCLIENT*)aThis; |
102 me->InterfaceStateChangeNotification(aInfo); |
102 me->InterfaceStateChangeNotification(aInfo); |
103 } |
103 } |
104 |
104 |