Mako 9.0.0 API
MakoCore SDK API Documentation
Loading...
Searching...
No Matches
iedlfactory.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2006-2026 Hybrid Software Helix 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
67 virtual bool classRegistered(const CClassID &id) = 0;
68
75 virtual IEDLObjectPtr createInstance(const CClassID &id, CClassParams *pParams = NULL) = 0;
76
84 virtual IEDLObjectPtr createInstanceJawsMako(const CClassID& id, CClassParams* pParams = NULL, IEDLClassFactory *factory = NULL) = 0;
85
91 virtual IEDLObjectPtr getSingleton(const CClassID &id) = 0;
92
97 virtual void markComplete() = 0;
98};
99
100template <class T>
102{
103 return edl_cast((T *)NULL, pFactory->createInstance(T::classID(),pParams));
104}
105
106template <class T>
107inline CSmartPtr<T> createInstance(IEDLClassFactory * pFactory, const CClassID & id,CClassParams *pParams = NULL)
108{
109 return edl_cast((T *)NULL, pFactory->createInstance(id,pParams));
110}
111
112template <class T>
113inline CSmartPtr<T> createInstance(IEDLClassFactory * pFactory, const EDLSysString &strName, CClassParams *pParams = NULL)
114{
115 CClassID id;
116 if (pFactory->findNamedClass(strName, id))
117 return edl_cast((T *)NULL, pFactory->createInstance(id, pParams));
118 else
119 return CSmartPtr<T>(NULL);
120}
121
122template <class T>
124{
125 return edl_cast((T *)NULL, pFactory->getSingleton(T::classID()));
126}
127
128template <class T>
130{
131 return edl_cast((T *)NULL, pFactory->getSingleton(id));
132}
133
135
136#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)
virtual void markComplete()=0
Marks the factory as complete. No other classes may be registered after the factory is marked as comp...
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 classRegistered(const CClassID &id)=0
Determine if a class with the given id has already been registered.
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:123
CSmartPtr< T > createInstance(IEDLClassFactory *pFactory, CClassParams *pParams=NULL)
Definition iedlfactory.h:101
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:222