Abstract base class of prototype libraries.
More...
#include <ilviews/protos/proto.h>
|
|
class | IlvGroup |
| |
|
class | IlvProtoInstance |
| |
|
class | IlvPrototype |
| |
Abstract base class of prototype libraries.
Library: ilvproto
A prototype library is a package that contains a set of prototypes. Prototype libraries make it possible to load and save a set of prototype description files as a single object. A prototype contained in a prototype library can be fetched by prefixing the name of the library with the name of the prototype when calling the external functions IlvGetPrototype() or IlvLoadPrototype(). IlvAbstractProtoLibrary is an abstract class and cannot be used directly. See IlvProtoLibrary for a simple prototype library class.
- See also
IlvPrototype, IlvProtoInstance, IlvProtoLibrary.
◆ IlvAbstractProtoLibrary()
| IlvAbstractProtoLibrary::IlvAbstractProtoLibrary |
( |
IlvDisplay * |
display, |
|
|
const char * |
name = 0 |
|
) |
| |
Creates a new and empty prototype library named name.
- Parameters
-
| display | Default display used when loading prototypes. Prototypes are display-independent, but operate more efficiently when they are instantiated on the same display they were created. |
| name | Name of the library. |
◆ addPrototype()
| void IlvAbstractProtoLibrary::addPrototype |
( |
IlvPrototype * |
prototype | ) |
|
Adds a prototype to the prototype library.
- Parameters
-
| prototype | Prototype to add. |
◆ getName()
| const char* IlvAbstractProtoLibrary::getName |
( |
| ) |
const |
Returns the name of the prototype library.
- Returns
- The name of the prototype library. If there is no such name, the string
"Unnamed" is return. You must not delete or modify the returned string.
◆ getPrototype()
Fetches a prototype from the library.
The prototype is loaded by the method, if it is not already loaded. If the prototype is already loaded and reload is IlTrue, the prototype is reloaded.
- Parameters
-
| name | Name of the prototype to be loaded. |
| reload | Specifies whether the prototype should be reread from its description file if it was already loaded. |
◆ getPrototypes()
Returns all the prototypes contained in the library.
- Parameters
-
| count | Contains, on return, the number of prototypes returned. |
- Returns
- An array of pointers to prototypes. The pointer to this array must be released using the
delete[] operator when no longer needed.
◆ load()
| virtual IlBoolean IlvAbstractProtoLibrary::load |
( |
istream * |
stream = 0, |
|
|
IlBoolean |
loadPrototypes = IlvAbstractProtoLibrary::LoadAll |
|
) |
| |
|
pure virtual |
Loads the prototype library from stream.
If stream is 0 a default location may be used, depending on the subclass. The default value for loadPrototypes is the static member variable LoadAll, which is IlTrue by default (it can be changed with the SetAutoLoadMode() method). If loadPrototypes is IlFalse, it will only be loaded on demand.
- Parameters
-
| stream | Stream to load the library from if it is non-null. Otherwise, subclasses may implement a means of retrieving the file describing the library. |
| loadPrototypes | If set to IlTrue, the prototypes are loaded immediately. Otherwise they are loaded only when needed, that is, when they need to be instantiated. |
◆ removePrototype()
| void IlvAbstractProtoLibrary::removePrototype |
( |
IlvPrototype * |
prototype | ) |
|
Removes a prototype from the prototype library.
- Parameters
-
| prototype | Prototype to remove. |
◆ save()
| virtual IlBoolean IlvAbstractProtoLibrary::save |
( |
ostream * |
stream = 0, |
|
|
IlBoolean |
savePrototypes = IlvAbstractProtoLibrary::LoadAll |
|
) |
| |
|
pure virtual |
Saves the prototype library to stream.
If stream is 0 a default location is used, depending on the subclass. The default value for savePrototypes is the static member variable LoadAll, which is IlTrue by default (it can be changed with the SetAutoLoadMode() method). If savePrototypes is IlFalse, the prototypes must be saved explicitly using the IlvGroup::save() method.
- Parameters
-
| stream | If non-null, the library is saved to the stream. Otherwise, subclasses may save the library to a known location. |
| savePrototypes | Specifies whether the prototype itself should be saved, in addition to the description of the library. |
◆ SetAutoLoadMode()
| static void IlvAbstractProtoLibrary::SetAutoLoadMode |
( |
IlBoolean |
loadAll | ) |
|
|
static |
Sets the default load mode of libraries.
- Parameters
-
| loadAll | If IlTrue, newly opened libraries will, by default, load all their prototypes. |