Mako 8.2.0 API
MakoCore SDK API Documentation
Loading...
Searching...
No Matches
iedlfactory.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2006-2025 Global Graphics Software Ltd. All rights reserved.
3 *
4 */
5
13
14#ifndef EDLIFACTORY_H
15#define EDLIFACTORY_H
16
17#include <edl/edltypes.h>
18#include <edl/edlstring.h>
19#include <edl/iedlobject.h>
20#include <edl/ircobject.h>
21#include <edl/objclassid.h>
22
24
31{
32public:
34 {}
35 typedef IEDLObjectPtr (*creatorFunc)(CClassParams *, IEDLClassFactory *);
36
44 virtual bool registerNamedClass(const EDLSysString &strName, const CClassID &id, bool overwrite = true) = 0;
45
52 virtual bool findNamedClass(const EDLSysString &strName, CClassID &id) = 0;
53
60 virtual bool registerClass(const CClassID &id, creatorFunc f) = 0;
61
68 virtual IEDLObjectPtr createInstance(const CClassID &id, CClassParams *pParams = NULL) = 0;
69
77 virtual IEDLObjectPtr createInstanceJawsMako(const CClassID& id, CClassParams* pParams = NULL, IEDLClassFactory *factory = NULL) = 0;
78
84 virtual IEDLObjectPtr getSingleton(const CClassID &id) = 0;
85};
86
87template <class T>
88inline CSmartPtr<T> createInstance(IEDLClassFactory * pFactory,CClassParams *pParams = NULL)
89{
90 return edl_cast((T *)NULL, pFactory->createInstance(T::classID(),pParams));
91}
92
93template <class T>
94inline CSmartPtr<T> createInstance(IEDLClassFactory * pFactory, const CClassID & id,CClassParams *pParams = NULL)
95{
96 return edl_cast((T *)NULL, pFactory->createInstance(id,pParams));
97}
98
99template <class T>
100inline CSmartPtr<T> createInstance(IEDLClassFactory * pFactory, const EDLSysString &strName, CClassParams *pParams = NULL)
101{
102 CClassID id;
103 if (pFactory->findNamedClass(strName, id))
104 return edl_cast((T *)NULL, pFactory->createInstance(id, pParams));
105 else
106 return CSmartPtr<T>(NULL);
107}
108
109template <class T>
111{
112 return edl_cast((T *)NULL, pFactory->getSingleton(T::classID()));
113}
114
115template <class T>
117{
118 return edl_cast((T *)NULL, pFactory->getSingleton(id));
119}
120
122
123#endif /* __EDLIFACTORY_H__ */
An object to represent a 128-bit globally unique ID.
Definition objclassid.h:29
EDL Object Interface.
Definition iedlobject.h:31
EDL Factory Interface allows one part of the EDL infrastructure to register class creation methods id...
Definition iedlfactory.h:31
virtual ~IEDLClassFactory()
Definition iedlfactory.h:33
virtual IEDLObjectPtr getSingleton(const CClassID &id)=0
Creates the EDL singleton (for example FontLibrary or ColorManager)
IEDLObjectPtr(* creatorFunc)(CClassParams *, IEDLClassFactory *)
Definition iedlfactory.h:35
virtual bool findNamedClass(const EDLSysString &strName, CClassID &id)=0
Retrieve GUID registered under the string name.
virtual bool registerClass(const CClassID &id, creatorFunc f)=0
Register a GUID with creator function.
virtual bool registerNamedClass(const EDLSysString &strName, const CClassID &id, bool overwrite=true)=0
Register a GUID under a string name.
virtual IEDLObjectPtr createInstance(const CClassID &id, CClassParams *pParams=NULL)=0
Creates the registered class by CClassID.
virtual IEDLObjectPtr createInstanceJawsMako(const CClassID &id, CClassParams *pParams=NULL, IEDLClassFactory *factory=NULL)=0
Creates the registered class by CClassID.
#define _BEGIN_EDL_NAMESPACE
Definition edlnamespaces.h:75
#define _END_EDL_NAMESPACE
Definition edlnamespaces.h:76
EDLString and EDLSysString classes and associated EDL string manipulation functions.
std::string EDLSysString
Definition edlstring.h:158
EDL "standard" types including known bit-length signed and unsigned integer type[def]s and definition...
#define EDL_API
Definition edltypes.h:86
CSmartPtr< T > getSingleton(IEDLClassFactory *pFactory)
Definition iedlfactory.h:110
CSmartPtr< T > createInstance(IEDLClassFactory *pFactory, CClassParams *pParams=NULL)
Definition iedlfactory.h:88
CSmartPtr< Type > edl_cast(Type *dst, IEDLObjectPtr src)
Definition iedlobject.h:91
Interface for Reference Counted Object.
An object class ID is a 128-bit globally unique ID (i.e. a GUID). In EDL it is abstracted within a CC...
#define CSmartPtr
Definition smartptr.h:215