|
|
CategoryFactory is the factory class for Category objects. CategoryFactory methods are mostly used by the Category Service, described in sysadmd(1M), to fulfill requests from remote clients. They can also be used by any server-side components that require information from a Category. Category subclasses will use the macros defined here.
To make information about a Category of type "catName" available to the rest of the system the following steps are required:
1. Implement a subclass of Category called "catName". - The subclass must have a void constructor. Typically, this calls the Category base class constructor with the argument "catName". - Use the convenience macro SaCATEGORY_REF_DECL in the header file to provide declaration for the routines used by the Category Service for obtaining Category instances. - In most cases, only one instance of a particular subclass of Category should exist in an address space. To enforce this, subclasses should protect their constructors and use the convenience macro SaCATEGORY_FRIEND_DEF in the class declaration in the header file. - Use the convenience macro SaCATEGORY_REF_DEF in the c++ file to provide the definition for the routines used by the Category Service for obtaining Category instances. This in turn will use the void constructor. 2. Create a library called "catName".so. 3. Install it in /usr/sysadm/category/
The above steps will allow clients to obtain the Category instance for "catName". Category.h describes the different methods supported by Category.
Category* |
[static]
Static get method. Creates a Category instance for catName, if it does not exist. Returns a reference counted Category instance.
The method fails if the Category instance cannot be created. On failure, returns NULL and errorString is initialized with the localized error string. This can happen if the library corresponding to catName cannot be loaded or if the library exists but does not define the symbols required.
bool |
[static]
Static release method. Decrements reference count for Category instance. Deletes the instance, if there are no references to it.
If no error is encountered in uninitializing the internal data structures used for creating the Category, returns true. Otherwise, returns false and errorString is initialized with the localized error string. This can happen if the library loaded for creation of the Category instance cannot be unloaded.
static const char* |
Used internally for logging.
Generated by: rusty@irem on Mon Sep 18 18:07:52 2000, using kdoc 2.0a36. |