The ILogger interface class supports logging of messages. More...
Public Types | |
typedef Interface_declare< id1, id2, id3, id4, id5, id6, id7, id8, id9, id10, id11, IInterface > |
Self |
Own type. More... |
|
typedef Uuid_t< id1, id2, id3, id4, id5, id6, id7, id8, id9, id10, id11 > |
IID |
Declares the interface ID (IID) of this interface. More... |
|
Public Member Functions | |
virtual void | message (Message_severity level, const char *module_category, const char *message)=0 |
Emits a message to the application's log. More... |
|
void | printf (Message_severity level, const char *module_category, const char *message,...) __attribute__((format(printf |
Emits a message to the application's log. More... |
|
virtual Uint32 | retain () const =0 |
Increments the reference count. More... |
|
virtual Uint32 | release () const =0 |
Decrements the reference count. More... |
|
virtual const IInterface * | get_interface (const Uuid &interface_id) const =0 |
Acquires a const interface from another. More... |
|
template<class T > | |
const T * | get_interface () const |
Acquires a const interface from another. More... |
|
virtual IInterface * | get_interface (const Uuid &interface_id)=0 |
Acquires a mutable interface from another. More... |
|
template<class T > | |
T * | get_interface () |
Acquires a mutable interface from another. More... |
|
virtual Uuid | get_iid () const =0 |
Returns the interface ID of the most derived interface. More... |
|
Static Public Member Functions | |
static bool | compare_iid (const Uuid &iid) |
Compares the interface ID iid against the interface ID of this interface and of its ancestors. More... |
|
The ILogger interface class supports logging of messages.
Plugins based on mi::base::Plugin are provided with a logger, such that plugins can be written to use the same message log as the host application.
Different APIs allow to register your own implementation of a logger to override their internal implementation. Note that in such case the object implementing this interface shall not be created on the stack, since this might lead to premature destruction of such instances while still being in use by the API.
The following message categories are used in some APIs. There might be other, undocumented categories.
category | purpose |
---|---|
"DATABASE" | database |
"DISK" | raw disk I/O, swapping |
"GEOMETRY" | geometry processing, e.g., tessellation |
"IMAGE" | texture processing, image and video plugins |
"IO" | scene data import and export |
"MAIN" | reserved for the application itself |
"MISC" | other |
"MEMORY" | memory management |
"NETWORK" | networking |
"PLUGIN" | plugins (unless other categories fit better) |
"RENDER" | rendering |
|
inherited |
Declares the interface ID (IID) of this interface.
|
inherited |
Own type.
|
inlinestaticinherited |
Compares the interface ID iid
against the interface ID of this interface and of its ancestors.
true
if iid
== IID()
or is equal to one of the interface IDs of its ancestors, and false
otherwise.
|
pure virtualinherited |
Returns the interface ID of the most derived interface.
Implemented in mi::base::Interface_implement_singleton< IAllocator >.
|
pure virtualinherited |
Acquires a const interface from another.
If this interface supports the interface with the passed interface_id
, then the method returns a non-NULL
const
mi::base::IInterface* that can be casted via static_cast
to an interface pointer of the interface type corresponding to the passed interface_id
. Otherwise, the method returns NULL
.
In the case of a non-NULL
return value, the caller receives ownership of the new interface pointer, whose reference count has been retained once. The caller must release the returned interface pointer at the end to prevent a memory leak.
interface_id | Interface ID of the interface to acquire. |
Implemented in mi::base::Interface_implement_singleton< IAllocator >.
|
inlineinherited |
Acquires a const interface from another.
If this interface supports the interface T
, then the method returns a non-NULL
const
pointer to the interface T
. Otherwise, the method returns NULL
.
In the case of a non-NULL
return value, the caller receives ownership of the new interface pointer, whose reference count has been retained once. The caller must release the returned interface pointer at the end to prevent a memory leak.
This templated member function is a wrapper of the non-template variant for the user's convenience. It eliminates the need to apply static_cast
to the returned pointer, since the return type already is a const pointer to the type T
specified as template parameter.
T | The requested interface type. |
|
pure virtualinherited |
Acquires a mutable interface from another.
If this interface supports the interface with the passed interface_id
, then the methods returns a non-NULL
mi::base::IInterface* that can be casted via static_cast
to an interface pointer of the interface type corresponding to the passed interface_id
. Otherwise, the method returns NULL
.
In the case of a non-NULL
return value, the caller receives ownership of the new interface pointer, whose reference count has been retained once. The caller must release the returned interface pointer at the end to prevent a memory leak.
interface_id | Interface ID of the interface to acquire. |
Implemented in mi::base::Interface_implement_singleton< IAllocator >.
|
inlineinherited |
Acquires a mutable interface from another.
If this interface supports the interface T
, then the method returns a non-NULL
pointer to the interface T
. Otherwise, the method returns NULL
.
In the case of a non-NULL
return value, the caller receives ownership of the new interface pointer, whose reference count has been retained once. The caller must release the returned interface pointer at the end to prevent a memory leak.
This templated member function is a wrapper of the non-template variant for the user's convenience. It eliminates the need to apply static_cast
to the returned pointer, since the return type already is a pointer to the type T
specified as template parameter.
T | The requested interface type. |
|
pure virtual |
Emits a message to the application's log.
The application can decide to output the message to any channel or to drop it.
This function can be called at any time from any thread, including concurrent calls from several threads at the same time.
level | The log level which specifies the severity of the message. |
module_category | The module and the category which specify the origin and the functional area of this message. The format of string parameter is "module:category". Both names are optional. The module name must not contain any colons. See above for valid category names. |
message | The log message. |
|
inline |
Emits a message to the application's log.
The application can decide to output the message to any channel or to drop it.
This function can be called at any time from any thread, including concurrent calls from several threads at the same time.
level | The log level which specifies the severity of the message. |
module_category | The module and the category which specify the origin and the functional area of this message. The format of string parameter is "module:category". Both names are optional. The module name must not contain any colons. See above for valid category names. |
message | The log message using printf()-like format specifiers, followed by matching arguments. The formatted message is limited to 1024 characters. |
|
pure virtualinherited |
Decrements the reference count.
Decrements the reference count of the object referenced through this interface and returns the new reference count. If the reference count dropped to zero, the object will be deleted. The operation is thread-safe.
Implemented in mi::base::Interface_implement_singleton< IAllocator >.
|
pure virtualinherited |
Increments the reference count.
Increments the reference count of the object referenced through this interface and returns the new reference count. The operation is thread-safe.
Implemented in mi::base::Interface_implement_singleton< IAllocator >.