Custom Platform Support Development Kit  1.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
FCMPluginInterface.h
Go to the documentation of this file.
1 /******************************************************************************
2 * ADOBE CONFIDENTIAL
3 * ___________________
4 *
5 * Copyright [2013] Adobe Systems Incorporated
6 * All Rights Reserved.
7 *
8 * NOTICE: All information contained herein is, and remains
9 * the property of Adobe Systems Incorporated and its suppliers,
10 * if any. The intellectual and technical concepts contained
11 * herein are proprietary to Adobe Systems Incorporated and its
12 * suppliers and are protected by all applicable intellectual
13 * property laws, including trade secret and copyright laws.
14 * Dissemination of this information or reproduction of this material
15 * is strictly forbidden unless prior written permission is obtained
16 * from Adobe Systems Incorporated.
17 ******************************************************************************/
18 
25 #ifndef FCM_PLUGIN_INTERFACE_H_
26 #define FCM_PLUGIN_INTERFACE_H_
27 
28 #include "FCMPreConfig.h"
29 #include "FCMTypes.h"
30 #include "FCMErrors.h"
31 #include "FCMMacros.h"
32 
33 #include "IFCMCalloc.h"
34 #include "IFCMCallback.h"
35 #include "IFCMList.h"
36 #include "IFCMClassFactory.h"
37 #include "IFCMPluginDictionary.h"
39 
40 #include "FCMPublicIDs.h"
41 
42 #include "assert.h"
43 
44 namespace FCM
45 {
46  //Forward declare IFCMUnknown
47  class IFCMUnknown;
48 
50  typedef struct {
51  FCMCLSID classID;
52  FCM::U_Int32 classVersion;
53  FCMIID interfaceID;
54  } FCMClassInterfaceInfo;
55 
56  typedef FCMClassInterfaceInfo* PFCMClassInterfaceInfo;
57 
58  inline FCM::Result _Delegate(
59  FCM::PVoid pv,
60  FCMIID riid,
61  FCM::PPVoid ppvObject,
62  FCM::S_Int64 dw)
63  {
65  IFCMUnknown* p = *((IFCMUnknown**)((FCM::S_Int64)pv + dw));
66  if (p != 0)
67  hRes = p->QueryInterface(riid, ppvObject);
68  return hRes;
69  }
70 
71  typedef FCM::Result (_FCM_CREATORARGFUNC)(
72  FCM::PVoid pv,
73  FCMIID riid,
74  FCM::PPVoid ppvObject,
75  FCM::S_Int64 dw);
76 
77  class FCMPluginModule;
78 
79  typedef IFCMClassFactory* (*FactorCreatorProc)(FCMPluginModule *) ;
80 
81 
82  typedef struct
83  {
84  FCMIID iid;
85  FCM::S_Int64 offset;
86  _FCM_CREATORARGFUNC* innerObjectFunc;
87  } FCMInterfaceMap;
88 
89 
90  typedef FCMInterfaceMap* (*InterfaceMapGetProc)() ;
91 
92  typedef struct
93  {
94  FCMCLSID clsid;
95  FactorCreatorProc pFactoryCreator;
96  InterfaceMapGetProc pGetInterfaceTable;
97  FCM::U_Int32 classVersion;
98  } FLCMClassMap;
99 
110  template<typename T>
111  class AutoPtr
112  {
113  public:
114 
116  T* m_Ptr;
117 
118  AutoPtr()
119  {
120  this->m_Ptr=0;
121  }
122 
131  AutoPtr(T* p)
132  {
133  this->m_Ptr=p;
134 
135  FCM_ADDREF(this->m_Ptr);
136 
137  }
138 
147  AutoPtr( const AutoPtr<T>& pObj)
148  {
149  this->m_Ptr=pObj.m_Ptr;
150 
151  FCM_ADDREF(this->m_Ptr);
152  }
153 
154 
171  template <typename Q>
172  AutoPtr(Q* p)
173  {
174  this->m_Ptr=0;
175 
176  if(!IsSameUnknown(p))
177  assignPtrWithQIOwnership(this->m_Ptr,p);
178 
179  }
180 
196  template <typename Q>
197  AutoPtr( const AutoPtr<Q>& pObj)
198  {
199  this->m_Ptr=0;
200 
201  if(!IsSameUnknown(pObj.m_Ptr))
202  assignPtrWithQIOwnership(this->m_Ptr,pObj.m_Ptr);
203 
204  }
205 
206  ~AutoPtr()
207  {
208  Reset();
209  }
210 
214  operator T*() const
215  {
216  return this->m_Ptr;
217  }
218 
222  T* operator->() const
223  {
224  assert(this->m_Ptr != 0);
225  return (this->m_Ptr);
226  }
227 
232  {
233  assert(this->m_Ptr == 0);
234  return &this->m_Ptr;
235  }
236 
242  operator bool() const
243  {
244  return (this->m_Ptr!=0);
245  }
246 
255  bool operator != (T* p) const
256  {
257  return (this->m_Ptr != p);
258  }
259 
268  bool operator == (T* p) const
269  {
270  return (this->m_Ptr == p);
271  }
272 
279  void operator =(T* p)
280  {
281  if(this->m_Ptr != p)
282  {
283  assignPtrWithOwnership(this->m_Ptr,p);
284  }
285  }
286 
293  void operator =(const AutoPtr<T>& pObj)
294  {
295  if(this->m_Ptr != pObj.m_Ptr)
296  {
297  assignPtrWithOwnership(this->m_Ptr,pObj.m_Ptr);
298 
299  }
300  }
301 
311  template <typename Q>
312  void operator =(const AutoPtr<Q>& pObj)
313  {
314  if(!IsSameUnknown(pObj.m_Ptr))
315  {
316  assignPtrWithQIOwnership(this->m_Ptr,pObj.m_Ptr);
317  }
318  }
319 
320 
329  template <typename Q>
330  void operator =(Q* p)
331  {
332  if(!IsSameUnknown(p))
333  {
334  assignPtrWithQIOwnership(this->m_Ptr,p);
335 
336  }
337  }
338 
343  void Reset()
344  {
345  FCM_RELEASE(this->m_Ptr);
346  }
347 
352  void Detach()
353  {
354  this->m_Ptr = 0;
355  }
356 
360  void Attach(T* p)
361  {
362  Reset();
363  this->m_Ptr = p;
364 
365  }
366 
371  template <typename Q>
372  bool IsSameUnknown(Q* pArg)
373  {
374  if( (pArg==0) && (0==this->m_Ptr))
375  return true;
376  if( (pArg==0) || (0==this->m_Ptr))
377  return false;
378 
379  PIFCMUnknown unkThis=0;
380  this->m_Ptr->QueryInterface(IFCMUnknown::GetIID(),(FCM::PPVoid)&unkThis);
381 
382  PIFCMUnknown unkArg=0;
383  pArg->QueryInterface(IFCMUnknown::GetIID(),(FCM::PPVoid)&unkArg);
384 
385  if(unkThis)
386  unkThis->Release();
387  if(unkArg)
388  unkArg->Release();
389 
390  return (unkThis == unkArg);
391 
392  }
393 
394  private:
395 
396  void assignPtrWithOwnership ( T*& pDest,T* pSource)
397  {
398  Reset();
399 
400  FCM_ADDREF(pSource);
401 
402  pDest = pSource;
403  }
404 
405  void assignPtrWithQIOwnership ( T*& pDest,PIFCMUnknown pSource)
406  {
407  Reset();
408 
409  if(pSource)
410  pSource->QueryInterface(T::GetIID(),(PPVoid)&pDest);
411 
412  }
413 
414 
415  };
416 
420  class FCMListPtr : public AutoPtr <IFCMList>
421  {
422  public:
423 
435  PIFCMUnknown operator [](FCM::U_Int32 index)
436  {
437  return this->m_Ptr->operator[](index);
438  }
439  };
440 
441 
442 
445  class FCMPluginModule
446  {
447  public:
448  struct ClassNode
449  {
450  FLCMClassMap m_ClassMap;
451  ClassNode* next;
452  };
453 
454  protected:
455  ClassNode* m_firstNode;
457  FCM::U_Int32 m_LiveObjectCounter;
458 
459  FCMPluginModule()
460  {
461  m_firstNode=0;
462  m_pCalloc=0;
463  m_LiveObjectCounter=0;
464  }
465  virtual ~FCMPluginModule()
466  {
467  }
468 
469  public:
470 
471  FCM::U_Int32 incrementAliveCount()
472  {
473  return ++m_LiveObjectCounter;
474  }
475  FCM::U_Int32 decrementAliveCount()
476  {
477  assert(m_LiveObjectCounter>0);
478  return --m_LiveObjectCounter;
479  }
480 
481  FCM::Result init(FCM::PIFCMCallback pCallback)
482  {
483  AutoPtr<IFCMUnknown> pCallocUnk;
484  FCM::Result res = pCallback->GetService(FCM::SRVCID_Core_Memory,pCallocUnk.m_Ptr);
485  m_pCalloc=pCallocUnk;
486  return res;
487  }
488 
489  FCM::Result getClassInfo(FCM::PIFCMCalloc pCalloc,FCM::PFCMClassInterfaceInfo* ppClassInfo)
490  {
491 
493  FCM::U_Int32 pairCount=0;
494  for( FCMPluginModule::ClassNode* pNode = m_firstNode; pNode != 0; pNode = pNode->next )
495  {
496  FCMInterfaceMap* pIntfIndex = pNode->m_ClassMap.pGetInterfaceTable();
497  for(; pIntfIndex && (pIntfIndex->iid != FCMIID_NULL); ++pIntfIndex){
498  if(pIntfIndex->iid == IID_IFCMUnknown )
499  continue;
500  ++pairCount;
501  }
502  }
503  PFCMClassInterfaceInfo arrClsIntfinfo = *ppClassInfo = (FCMClassInterfaceInfo *) pCalloc->Alloc((sizeof(FCMClassInterfaceInfo)*(pairCount+2)));
504 
505  if(!arrClsIntfinfo)
506  return FCM_MEM_NOT_AVAILABLE;
507 
508  arrClsIntfinfo[0].classID = FCMCLSID_NULL;
509  arrClsIntfinfo[0].classVersion = (FCM::U_Int32)(FCM_VERSION);
510  arrClsIntfinfo[0].interfaceID = FCMIID_NULL;
511 
512  arrClsIntfinfo[pairCount+1].classID = FCMCLSID_NULL;
513  arrClsIntfinfo[pairCount+1].classVersion = 0;
514  arrClsIntfinfo[pairCount+1].interfaceID = FCMIID_NULL;
515 
516  pairCount=0;
517  for( FCMPluginModule::ClassNode* pNode = m_firstNode; pNode != 0; pNode = pNode->next )
518  {
519  FCMInterfaceMap* pIntfIndex = pNode->m_ClassMap.pGetInterfaceTable();
520  for(; pIntfIndex && (pIntfIndex->iid != FCMIID_NULL); ++pIntfIndex)
521  {
522  if(pIntfIndex->iid == IID_IFCMUnknown )
523  continue;
524  arrClsIntfinfo[pairCount+1].classID = pNode->m_ClassMap.clsid;
525  arrClsIntfinfo[pairCount+1].classVersion =pNode->m_ClassMap.classVersion;
526  arrClsIntfinfo[pairCount+1].interfaceID = pIntfIndex->iid;
527 
528  ++pairCount;
529  }
530  }
531  return FCM_SUCCESS;
532  }
533 
534 
535  FCM::Result getClassObject(FCM::PIFCMUnknown pUnkOuter,FCM::ConstRefFCMCLSID clsid, FCM::ConstRefFCMIID iid, FCM::PPVoid pAny)
536  {
537  using namespace FCM;
539 
540 
541  for( FCMPluginModule::ClassNode* pNode = m_firstNode; pNode != 0; pNode = pNode->next )
542  {
543  if( pNode->m_ClassMap.clsid == clsid) {
544  PIFCMClassFactory pf = pNode->m_ClassMap.pFactoryCreator(this);
545  res= pf->QueryInterface(iid,pAny);
546  pf->Release();
547  return res;
548  }
549  }
550  return FCM_CLS_NOT_DEFINED;
551  }
552  FCM::U_Int32 canUnloadNow(void)
553  {
554  return m_LiveObjectCounter;
555  }
556  void finalize()
557  {
558  if(!m_pCalloc)
559  return;
560 
561  ClassNode* current=m_firstNode;
562  ClassNode* prev=0;
563  while(current)
564  {
565  prev=current;
566  current= current->next;
567  m_pCalloc->Free(prev);
568  }
569 
570  //Release the ICalloc now. Don't delay till destructor
571  m_pCalloc.Reset();
572  }
573 
574  protected:
575 
576  void addClassEntry ( FCMCLSID clsid, FactorCreatorProc pFactoryCreator, InterfaceMapGetProc pGetInterfaceTable, FCM::U_Int32 classVersion)
577  {
578  if(!m_pCalloc)
579  return;
580 
581  ClassNode* newnode = (ClassNode*)m_pCalloc->Alloc(sizeof(ClassNode));
582  if(!newnode)
583  return;
584  newnode->next=0;
585  newnode->m_ClassMap.clsid = clsid;
586  newnode->m_ClassMap.pFactoryCreator = pFactoryCreator;
587  newnode->m_ClassMap.pGetInterfaceTable = pGetInterfaceTable;
588  newnode->m_ClassMap.classVersion = classVersion;
589 
590  if(!m_firstNode)
591  {
592  m_firstNode=newnode;
593  }
594  else
595  {
596  ClassNode* current=m_firstNode;
597  ClassNode* prev=0;
598  while(current)
599  {
600  prev=current;
601  current= current->next;
602  }
603  prev->next = newnode;
604  }
605  }
606 
607  };
608 
616  {
617  public:
618 
623  {
624  return FCM_SUCCESS;
625  }
626  };
627 
630  template<typename IntfImpl>
631  class FCMObject : public IntfImpl,public IFCMNoAggregationUnknown
632  {
633  private:
634  FCM::U_Int32 mRefCount;
635  PIFCMCallback m_pPIFCMCallback;
636  PIFCMUnknown m_pUnknownOuter;
637  FCMPluginModule *m_pModule;
638 
639  public:
640  FCMObject(FCMPluginModule *pModule)
641  {
642  mRefCount=0;
643  m_pPIFCMCallback=0;
644  m_pUnknownOuter=0;
645  m_pModule=pModule;
646  assert(pModule);
647  m_pModule->incrementAliveCount();
648  }
649  virtual ~FCMObject()
650  {
651  m_pModule->decrementAliveCount();
652  }
653 
654  void FCMInit(PIFCMCallback pIFCMCallback,PIFCMUnknown pUnknownOuter)
655  {
656  m_pPIFCMCallback=pIFCMCallback;
657 
658  if (!pUnknownOuter)
659  {
660  m_pUnknownOuter = reinterpret_cast<IFCMUnknown*>(
661  static_cast<IFCMNoAggregationUnknown*>(this));
662  }
663  else
664  {
665  m_pUnknownOuter = pUnknownOuter;
666  }
667  }
668 
669  virtual PIFCMCallback GetCallback()
670  {
671  return m_pPIFCMCallback;
672  }
673 
674  virtual FCMPluginModule * GetPluginModule()
675  {
676  return m_pModule;
677  }
678  virtual FCM::U_Int32 InternalAddRef()
679  {
680  return AddRef();
681  }
682  virtual FCM::U_Int32 InternalRelease()
683  {
684  return Release();
685  }
686  virtual FCM::Result InternalQueryInterface(ConstRefFCMIID pInterfaceID, FCM::PPVoid ppvObj)
687  {
688  return QueryInterface(pInterfaceID,ppvObj);
689  }
690 
691 
692  FCM::Result QueryInterface (ConstRefFCMIID pInterfaceID, FCM::PPVoid ppvObj)
693  {
694  return m_pUnknownOuter->QueryInterface(pInterfaceID,ppvObj);
695  }
696 
697  FCM::U_Int32 AddRef ()
698  {
699  return m_pUnknownOuter->AddRef();
700  }
701  FCM::U_Int32 Release ()
702  {
703  return m_pUnknownOuter->Release();
704  }
705 
706  FCM::Result MainQueryInterface (ConstRefFCMIID pInterfaceID, FCM::PPVoid ppvObj)
707  {
708  FCMInterfaceMap* pIntfMap = IntfImpl::GetInterfaceMap();
710  while( pIntfMap && pIntfMap->iid != FCMIID_NULL)
711  {
712  if(pInterfaceID == pIntfMap->iid && ppvObj )
713  {
714  if(pIntfMap->innerObjectFunc == _FCM_SIMPLEMAPENTRY)
715  {
716  if (pInterfaceID == IID_IFCMUnknown) {
717  *ppvObj = static_cast<IFCMNoAggregationUnknown*>(this);
718  }
719  else
720  {
721  *ppvObj = (IFCMUnknown *)((FCM::S_Int64 )this + pIntfMap->offset );
722  }
723  ( reinterpret_cast<IFCMUnknown *>(*ppvObj))->AddRef();
724  res = FCM_SUCCESS;
725  break;
726  }
727  else
728  {
729  res = pIntfMap->innerObjectFunc((FCM::PVoid)this,pInterfaceID,ppvObj,pIntfMap->offset);
730  break;
731  }
732  }
733 
734  ++pIntfMap;
735  }
736  return res;
737  }
738  FCM::U_Int32 NoAggregationAddRef ()
739  {
740  mRefCount++;
741  return mRefCount;
742  }
743  FCM::U_Int32 NoAggregationRelease ()
744  {
745  assert(mRefCount > 0);
746  FCM::U_Int32 refCount = --mRefCount;
747  if(refCount==0)
748  {
749  delete this;
750  }
751  return refCount;
752  }
753 
754  };
755 
756  template<class T>
757  class IntfImpl_Traits
758  {
759  public:
760  static FCM::Result CreateInstance(FCMPluginModule *pModule,PIFCMCallback pCallback,PIFCMUnknown pUnkOuter,T*& out)
761  {
763  out = new T(pModule);
764  out->FCMInit(pCallback,pUnkOuter);
765  res=out->InitDone();
766  if(FCM_FAILURE_CODE(res))
767  {
768  delete out;
769  out=0;
770  return res;
771  }
772  return res;
773  }
774  };
775 
776 
777  template<class T>
778  class FCMClassFactory:public IFCMClassFactory, public FCMObjectBase
779  {
780  public:
781  FCMClassFactory()
782  {
783 
784  }
785  BEGIN_INTERFACE_MAP(FCMClassFactory,FCM_VERSION)
788 
789  FCM::Result CreateInstance(PIFCMUnknown pUnkOuter,PIFCMCallback pCallback,ConstRefFCMIID iid, FCM::PPVoid pAny)
790  {
792  if (pUnkOuter && (iid != IID_IFCMUnknown))
793  return FCM_NO_AGGREGATION;
794 
795  FCMObject<T>* pNewObject =0;
796  res= IntfImpl_Traits<FCMObject<T> >::CreateInstance(GetPluginModule(),pCallback,pUnkOuter,pNewObject);
797  if(FCM_FAILURE_CODE(res))
798  return res;
799 
800  res=pNewObject->MainQueryInterface(iid,pAny);
801  if(FCM_SUCCESS_CODE(res))
802  {
803  return res;
804  }
805  else
806  delete pNewObject;
807 
808  return res;
809  }
810  static PIFCMClassFactory GetFactory( FCMPluginModule *pModule)
811  {
812 
813  FCMObject<FCMClassFactory<T> >* pFact =0;
814  FCM::Result res = IntfImpl_Traits<FCMObject<FCMClassFactory<T> > >::CreateInstance(pModule,0,0,pFact);
815  if(FCM_FAILURE_CODE(res))
816  return 0;
817  FCM_ADDREF(pFact);
818  return pFact;
819  }
820 
821  virtual FCMPluginModule * GetPluginModule()=0;
822  };
823 
833  typedef FCM::Result (*PluginBootProc)(PIFCMCallback pCallback);
834 
849  typedef FCM::Result (*PluginGetClassInfoProc)(PIFCMCalloc pCalloc,PFCMClassInterfaceInfo* ppClassInfo);
850 
879  typedef FCM::Result (*PluginGetClassObjectProc)(PIFCMUnknown pUnkOuter,
881 
894  typedef FCM::Result (*PluginRegisterProc)(PIFCMPluginDictionary pPluginDict);
895 
909 
919 
920 
923  typedef struct
924  {
925  /* Boot function will be called immediately after the DLL/framework load.
926  * Perfrom any global intitialization inside this
927  */
928  PluginBootProc m_pBoot;
929 
930  /* GetClassinfo is used to find out the different classes implemented
931  * by the plugin. Do no perform any app specific logic here
932  */
933  PluginGetClassInfoProc m_pGetClassInfo;
934 
935 
936  /* GetClassObject is used to create the factory for each class implemented
937  * by the plugin. Do no perform any app specific logic here
938  */
939  PluginGetClassObjectProc m_pGetClassObject;
940 
941  /* Register function is used publish the services and capabilities of the plugin.
942  * This may not be called for plugin loading
943  */
944  PluginRegisterProc m_pRegister;
945 
946  /* CanUnloadNow returns the number of live object instances from by this plugin.
947  * Just before the shutdown all the instances should be deleted and zero should be returned
948  */
949  PluginCanUnloadNowProc m_pCanUnloadNow;
950 
951  /* Shutdown allows the plugin to do proper clean-up before unloading.
952  */
953  PluginShutdownProc m_pShutdown;
954  } PluginProcs;
955 
958 };
959 
960 #include "FCMPostConfig.h"
961 
962 #endif // FCM_PLUGIN_INTERFACE_H_
void Reset()
Resets the pointer after calling Release.
Definition: FCMPluginInterface.h:343
This file contains definitions for various data types.
This file contains interface for IFCMClassFactory. IFCMClassFactory enables a class of objects to be ...
FCM::Result(* PluginGetClassInfoProc)(PIFCMCalloc pCalloc, PFCMClassInterfaceInfo *ppClassInfo)
Defines the type of a function used by FCM framework to know various classes implemented by the plug-...
Definition: FCMPluginInterface.h:849
unsigned _int32 U_Int32
Type to define an unsigned 32-bit value.
Definition: FCMTypes.h:81
bool IsSameUnknown(Q *pArg)
Returns true if the underlying IFCMUnknown pointer this object is same as that of the argument...
Definition: FCMPluginInterface.h:372
The definitions contained in this namespace define a framework called Flash Component Model (FCM)...
Definition: IGroup.h:36
#define FCM_VERSION
Complete version of the framework.
Definition: FCMMacros.h:78
FCM::Result(* PluginShutdownProc)()
Defines the function called by FCM framework to notify the plug-in that the plug-in will be unloaded ...
Definition: FCMPluginInterface.h:918
void Detach()
Detaches the pointer without calling Release.
Definition: FCMPluginInterface.h:352
T ** operator&()
The address operator that returns the address of pointer held by this object.
Definition: FCMPluginInterface.h:231
bool operator!=(T *p) const
The != comparison operator.
Definition: FCMPluginInterface.h:255
const FCMIID FCMIID_NULL
Represents an invalid Interface Identifier (IID).
Definition: FCMTypes.h:392
void ** PPVoid
Type to define a pointer to pointer to void.
Definition: FCMTypes.h:154
virtual FCM::PVoid _FCMCALL Alloc(FCM::U_Int32 cb)=0
Allocates memory of the size requested by the parameter cb.
#define FCM_FAILURE_CODE(x)
Returns True if x is not success code, else False.
Definition: FCMErrors.h:52
#define FCM_GENERAL_ERROR
General error code.
Definition: FCMErrors.h:76
A class implementing the AutoPtr.
Definition: FCMPluginInterface.h:420
Defines the interface that represents the NoAggregationUnknown.
Definition: IFCMNoAggregationUnknown.h:68
PIFCMUnknown operator[](FCM::U_Int32 index)
The array index operator to access the object at a particular index.
Definition: FCMPluginInterface.h:435
#define FCM_ADDREF(intPtr)
If intPtr exists, increment its reference count.
Definition: FCMMacros.h:185
T * operator->() const
The member access operator to get the pointer held by this object.
Definition: FCMPluginInterface.h:222
Defines the interface that represents the ClassFactory.
Definition: IFCMClassFactory.h:67
AutoPtr(T *p)
Constructs an AutoPtr object.
Definition: FCMPluginInterface.h:131
AutoPtr(const AutoPtr< T > &pObj)
Copy constructor for AutoPtr
Definition: FCMPluginInterface.h:147
This defines smart pointer to manage AddRef and Release calls to FCM objects. In AutoPtr ...
Definition: FCMPluginInterface.h:111
AutoPtr(Q *p)
Constructs an AutoPtr object from a pointer to Q, where both T and Q have to be interfaces deriv...
Definition: FCMPluginInterface.h:172
#define INTERFACE_ENTRY(ifx)
Add an interface.
Definition: FCMMacros.h:267
#define FCM_SUCCESS_CODE(x)
Returns True if x is success code, else False.
Definition: FCMErrors.h:44
void operator=(T *p)
The overloaded assignment operator to assign a pointer.
Definition: FCMPluginInterface.h:279
U_Int32 Result
Type to define a result. This is usually the return type for most APIs.
Definition: FCMTypes.h:126
This file contains interface for IFCMPluginDictionary. The IFCMPluginDictionary interface provides a ...
Represents a 128 bit or 16-byte GUID (Globally Unique IDentifier) value.
Definition: FCMTypes.h:189
FCM::Result(* PluginGetClassObjectProc)(PIFCMUnknown pUnkOuter, ConstRefFCMCLSID clsid, ConstRefFCMIID iid, FCM::PPVoid pAny)
Defines the function called by FCM framework to get the factory objects for the classes implemented b...
Definition: FCMPluginInterface.h:879
#define END_INTERFACE_MAP
Format to end the interface map.
Definition: FCMMacros.h:295
FCM::Result InitDone()
This function is used by the framework and should not be called by clients.
Definition: FCMPluginInterface.h:622
FCMGUID FCMCLSID
Represents the class ID type.
Definition: FCMTypes.h:322
This file contains interface for IFCMCalloc. The IFCMCalloc interface provides a mechanism for alloca...
This file contains interface for IFCMNoAggregationUnknown and needed to support "Aggregation". This interface is used by FCM internally. It is not meant to be used by external clients.
#define FCM_CLS_NOT_DEFINED
Error code is returned if class is not defined.
Definition: FCMErrors.h:85
This file contains all the public IDs used in FCM.
Every class that implements an interface should be derived from this class.
Definition: FCMPluginInterface.h:615
FCM::U_Int32(* PluginCanUnloadNowProc)(void)
Defines the function called by FCM framework to check if the plug-in can be unloaded. This function returns the number of live object instances from by this plug-in. Just before the shutdown, all the instances should be deleted and zero should be returned.
Definition: FCMPluginInterface.h:908
#define FCM_NO_AGGREGATION
Error code is returned if the interface is not found in case of aggregation.
Definition: FCMErrors.h:158
Defines the interface that represents the IUnknown object.
Definition: IFCMUnknown.h:69
const FCMCLSID FCMCLSID_NULL
Represents an invalid class Identifier (CLSID).
Definition: FCMTypes.h:399
FCM::Result(* PluginBootProc)(PIFCMCallback pCallback)
Defines the type of a function that will be called immediately after the DLL/framework load...
Definition: FCMPluginInterface.h:833
AutoPtr(const AutoPtr< Q > &pObj)
Constructs an AutoPtr object from an AutoPtr object, where both T and Q are interfaces deri...
Definition: FCMPluginInterface.h:197
#define FCM_MEM_NOT_AVAILABLE
Error code is returned if memory is not available.
Definition: FCMErrors.h:93
This file contains all the errors used in FCM.
#define _FCM_SIMPLEMAPENTRY
This macro makes debugging asserts easier.
Definition: FCMMacros.h:105
#define BEGIN_INTERFACE_MAP(impl, implVersion)
Format to begin Interface map.
Definition: FCMMacros.h:237
bool operator==(T *p) const
The == comparison operator.
Definition: FCMPluginInterface.h:268
T * m_Ptr
Definition: FCMPluginInterface.h:116
This file contains the macros used in FCM.
This file contains interface for IFCMList. List of pointer to IFCMUnknown objects.
FCMGUID FCMIID
Represents the interface ID type.
Definition: FCMTypes.h:315
#define FCM_SUCCESS
Success code.
Definition: FCMErrors.h:68
#define FCM_RELEASE(intPtr)
If intPtr exists, decrement its reference count.
Definition: FCMMacros.h:193
This file contains interface for IFCMCallback. The IFCMCallback interface is a glue for the objects c...
#define FCM_NO_INTERFACE
Error code is returned if interface is not available.
Definition: FCMErrors.h:101
virtual void _FCMCALL Free(FCM::PVoid pv)=0
Deallocates the memory pointed by the param pv.
void Attach(T *p)
Attaches the pointer without calling AddRef.
Definition: FCMPluginInterface.h:360
void * PVoid
Type to define a void pointer.
Definition: FCMTypes.h:147
signed _int64 S_Int64
Type to define a signed 64-bit value.
Definition: FCMTypes.h:102
const FCM::SRVCID SRVCID_Core_Memory
Defines the universally-unique ID for the memory service.
Definition: FCMPublicIDs.h:74
FCM::Result(* PluginRegisterProc)(PIFCMPluginDictionary pPluginDict)
Defines the function called by FCM framework to register the plug-in. The plug-in has to add the deta...
Definition: FCMPluginInterface.h:894