7 #ifndef __plugin_Component_h__ 8 #define __plugin_Component_h__ 10 #define FE_COMPONENT_TRACK FE_COUNTED_TRACK 34 const String& name(
void)
const {
return m_name; }
35 void setName(
const String& name) { m_name=name; }
37 void attach(
Component* pComponent,BWORD singleton);
38 void detach(
Component* pComponent,BWORD singleton);
51 #if FE_CPLUSPLUS >= 201103L 123 BWORD quiet=FALSE)
const;
156 { m_factoryIndex=a_factoryIndex; }
177 virtual void acquire(
void);
184 virtual void release(
void);
188 void assignHub(
Hub* pHub);
189 void setStray(BWORD stray);
211 FE_DL_EXPORT
void FE_CDECL checkUnload(
sp<Library>& pLibrary,
219 #if FE_COUNTED_MT && FE_COMPONENT_TRACK 220 RecursiveMutex::Guard guard(Counted::ms_counted_mutex);
226 if(m_hpHub.isValid())
228 if(refCount==2+isSingleton())
235 m_hpHub->trackReference(
this,
"Component::acquire");
239 #if FE_COMPONENT_TRACK 240 if(refCount && registry().isValid())
242 registry()->
tracker().acquire(
this,name(),refCount);
257 #if FE_COUNTED_MT && FE_COMPONENT_TRACK 258 RecursiveMutex::Guard guard(Counted::ms_counted_mutex);
261 #if FE_COMPONENT_TRACK 262 if(count() && registry().isValid())
264 registry()->
tracker().release(
this,verboseName(),count()-1);
268 refCount=releaseInternal();
269 if(m_hpHub.isValid())
271 if(refCount==1+isSingleton())
294 fe::internal::checkUnload(m_spLibrary,
this);
306 throw fe::Exception(e_invalidPointer,
"Component Assertion Error",
307 "%s as %s", spC->name().c_str(), FE_TYPESTRING(T).c_str());
311 throw fe::Exception(e_invalidPointer,
"Component Assertion Error",
312 "invalid component");
318 #if FE_COMPILER==FE_GNU 319 #define feCast(T, comp) (fe::Exception::stage(__FILE__,__LINE__,__PRETTY_FUNCTION__),component_cast<T>(comp)) 320 #elif FE_COMPILER==FE_MICROSOFT 321 #define feCast(T, comp) (fe::Exception::stage(__FILE__,__LINE__,__FUNCTION__),component_cast<T>(comp)) 323 #define feCast(T, comp) (fe::Exception::stage(__FILE__,__LINE__,__func__),component_cast<T>(comp)) Fully Bidirectional Doubly-Linked List.
Definition: List.h:496
virtual void acquire(void)
Increment the reference count.
Definition: Counted.h:64
const String verboseName(void) const
Return the annotated chosen name.
Definition: Component.h:79
kernel
Definition: namespace.dox:3
I32 factoryIndex(void)
Get the library's factory index.
Definition: Component.h:163
Generic exception carrying a fe::String payload.
Definition: Exception.h:34
BWORD isSingleton(void)
Return whether component is a singleton.
Definition: Component.h:170
Tracker & tracker(void)
Access the component tracker.
Definition: Registry.h:121
void setSingleton(BWORD set)
Specify whether component is a singleton.
Definition: Component.h:168
Automatically reference-counted string container.
Definition: String.h:128
Base for all interfacable components.
Definition: Component.h:20
Intrusive Smart Pointer.
Definition: src/core/ptr.h:53
const String & name(void) const
Return the components chosen name.
Definition: Component.h:77
Base class providing an fe::Handle to the derived class.
Definition: Handled.h:209
sp< Library > library(void)
Get the library that created the component.
Definition: Component.h:150
void setName(const String &name)
Rename the component to anything you want.
Definition: Component.h:84
Base class providing collective initialization (post-constructor)
Definition: Initialized.h:56
virtual void acquire(void)
Specialized reference increment.
Definition: Component.h:215
virtual void release(void)
Specialized reference decrement.
Definition: Component.h:249
void setFactoryIndex(I32 a_factoryIndex)
Set the library's factory index.
Definition: Component.h:155
Reference hub used by Component::adjoin()
Definition: Component.h:28
Per-class participation non-RTTI fallback dynamic casting mechanism.
Definition: Castable.h:192