7 #ifndef __plugin_Library_h__ 8 #define __plugin_Library_h__ 70 { m_className.sPrintf(
"Factory<%s>",name.
c_str());
87 I32 a_factoryIndex)
const =0;
110 I32 a_factoryIndex)
const 115 this->name(),pLibrary,a_factoryIndex));
119 if(!spComponent.isValid())
121 feX(
"fe::Library::Factory<T>::create",
122 "%s is not a valid fe::Component",
123 this->name().c_str());
136 template <
typename T>
142 template <
typename T>
160 U32 adjustedReferences(
void)
const;
172 void releaseSingletons(
void);
174 I32 strayCount(
void) {
return m_strayCount; }
175 I32 adjustStrayCount(I32 inc)
176 {
return m_strayCount+=inc; }
184 String factoryName(U32 factoryIndex);
193 {
return m_spChainLibrary; }
199 { m_spChainLibrary=rspLibrary; }
230 I32 a_factoryIndex= -1)
236 initComponent(spComponent,pT,
sizeof(T),
237 name,pLibrary,a_factoryIndex);
243 if(e.getResult()==e_cannotCreate)
245 #if FE_CODEGEN<=FE_DEBUG 246 feLog(
"Library::create" 247 " cannot create \"%s\"\n",
258 feLog(
"Library::create" 259 " uncaught exception\n");
269 void* ptr,U32 size,
String name,
270 Library* pLibrary,I32 a_factoryIndex);
290 void addFactory(
BaseFactory *pFactory,BWORD singleton);
const String & name(void) const
Return the library name.
Definition: Library.h:147
Object level locking for thread safety.
Definition: Safe.h:216
Raw access to a dynamic library.
Definition: DL_Loader.h:18
Type-nonspecific base class for factories.
Definition: Library.h:65
Type-specific factory template.
Definition: Library.h:98
const FESTRING_I8 * c_str(void) const
Return the contents of the 8-bit buffer cast as signed bytes.
Definition: String.h:352
Heap-based support for classes participating in fe::ptr <>
Definition: Counted.h:35
String prechop(const String &prefix) const
Return the substring after the prefix.
Definition: String.cc:118
void setName(const char *a_name)
for use in static lib scenario
Definition: Library.h:202
kernel
Definition: namespace.dox:3
Dynamic Library Manager.
Definition: Registry.h:25
void log(void)
Send the message to the global log.
Definition: Exception.cc:201
DL_Loader * getLoader(void) const
Definition: Library.h:206
Generic exception carrying a fe::String payload.
Definition: Exception.h:34
void setLoader(DL_Loader *pLoader)
Definition: Library.h:208
String basename(void) const
Return the substring following the last '/'.
Definition: String.cc:98
sp< Library > getChainLibrary(void) const
Definition: Library.h:192
Interface into a dynamic library to access its factories.
Definition: Library.h:60
Automatically reference-counted string container.
Definition: String.h:128
const String & name(void) const
Return the factory's type's name.
Definition: Library.h:75
void setChainLibrary(sp< Library > &rspLibrary)
Enforce FIFO by referencing prev lib on stack.
Definition: Library.h:198
Wrapper for std::vector.
Definition: Array.h:21
const String verboseName(void) const
Return the factory's templated name.
Definition: Library.h:78
static sp< Component > create(String name, Library *pLibrary=NULL, I32 a_factoryIndex=-1)
Instantiate and initialize a component without using a factory.
Definition: Library.h:229
Intrusive Smart Pointer.
Definition: src/core/ptr.h:53
void add(const String &name)
Create a named factory for the given type and add it to the library's collection. ...
Definition: Library.h:137
void addSingleton(const String &name)
Create a named factory for the given type, but treat it as a singleton.
Definition: Library.h:143
virtual sp< Component > create(Library *pLibrary, I32 a_factoryIndex) const
Instantiate a component.
Definition: Library.h:109
const String & name(void) const
Returns the name of the library as it was opened.
Definition: DL_Loader.h:51
String chop(const String &suffix) const
Return the substring before the suffix.
Definition: String.cc:159