Fovia's C++ Client/Server API
Public Member Functions | List of all members
ILibrary Struct Referenceabstract
Inheritance diagram for ILibrary:
IRoot

Public Member Functions

virtual signed int AskInterface (const BGUID *piid, IRoot **ppr)=0
 
virtual signed int CreateAggObject (const BGUID *clsid, const BGUID *piid, int *pReserved, IRoot **ppr)=0
 
virtual signed int CreateObject (const BGUID *clsid, const BGUID *piid, IRoot **ppr)=0
 
template<class T >
signed int CreateObject (const BGUID *clsid, T **pp)
 
virtual signed int DecRef ()=0
 
virtual signed int GetAllocator (int id, IAllocator **pp)=0
 
virtual signed int GetLibraryLogger (ILibraryLogger **pp)=0
 
virtual signed int IncRef ()=0
 
virtual signed int SetAllocator (int id, IAllocator *p)=0
 
virtual signed int SetLibraryLogger (ILibraryLogger *p)=0
 
- Public Member Functions inherited from IRoot
template<class T >
signed int AskInterface (T **pp)
 

Detailed Description

Library interface. An implementation of this interface should be the starting point for any BCOM-based library. Using this interface, a user can create objects exposed by the library using CreateObject() as well as set and get allocators for the library using SetAllocator() and GetAllocator().

Member Function Documentation

virtual signed int ILibrary::AskInterface ( const BGUID piid,
IRoot **  ppr 
)
pure virtual

Queries this object to see if the interface piid is supported and returns the result in ppr.

Parameters
piidThe BGUID of the requested interface.
pprThe address of an IRoot pointer which will receive the new interface.
Returns
S_OK if the interface is supported. E_FAIL if it is not.

Implements IRoot.

virtual signed int ILibrary::CreateAggObject ( const BGUID clsid,
const BGUID piid,
int *  pReserved,
IRoot **  ppr 
)
pure virtual

Reserved for future use

virtual signed int ILibrary::CreateObject ( const BGUID clsid,
const BGUID piid,
IRoot **  ppr 
)
pure virtual

Creates an object with the specified CLSID and IID. The templated CreateObject is probably the most convenient form to use.

Parameters
clsidClass ID for the objcet
piidIID for the object
pprPointer to an interface pointer that will receive the location of the new object.
template<class T >
signed int ILibrary::CreateObject ( const BGUID clsid,
T **  pp 
)
inline

Function template for CreateObject. It will determine the IID automatically via GET_INTERFACE_BGUID().

virtual signed int ILibrary::DecRef ( )
pure virtual

Decreases the reference count on this object by 1. If the reference count reaches 0, the object is deallocated.

Implements IRoot.

virtual signed int ILibrary::GetAllocator ( int  id,
IAllocator **  pp 
)
pure virtual

Gets an allocator with the specified id and returns it in the interface pointer at address pp.

Parameters
idThe library-specific id that identifies which allocator is being retreived.
ppThe address of the variable to get the interface pointer.
virtual signed int ILibrary::GetLibraryLogger ( ILibraryLogger **  pp)
pure virtual

Gets the ILibraryLogger class.

Parameters
ppThe output ILibraryLogger class.
virtual signed int ILibrary::IncRef ( )
pure virtual

Increases the reference count on this object by 1. You do not need to call this after an object is first created. It is 1 by default.

Implements IRoot.

virtual signed int ILibrary::SetAllocator ( int  id,
IAllocator p 
)
pure virtual

Sets an allocator with the specified id.

Parameters
idThe library-specific id that identifies which allocator is being set.
pThe new allocator to use for allocator ID id.
virtual signed int ILibrary::SetLibraryLogger ( ILibraryLogger p)
pure virtual

Sets the ILibraryLogger class.

Parameters
pThe input ILibraryLogger class.