rwlogo
Rogue Wave Views 5.5.1

Rogue Wave Views
Prototypes Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

IlvAbstractProtoLibrary Class Reference

Abstract base class of prototype libraries. More...

#include <ilviews/protos/proto.h>

Inheritance diagram for IlvAbstractProtoLibrary:
IlvProtoLibrary

List of all members.

Public Member Functions

 IlvAbstractProtoLibrary (IlvDisplay *display, const char *name=0)
 Creates a new and empty prototype library named name.
void addPrototype (IlvPrototype *prototype)
 Adds a prototype to the prototype library.
const char * getName () const
 Returns the name of the prototype library.
IlvPrototypegetPrototype (const char *name, IlBoolean reload=IlFalse)
 Fetches a prototype from the library.
IlvPrototype ** getPrototypes (IlUInt &count)
 Returns all the prototypes contained in the library.
virtual IlBoolean load (istream *stream=0, IlBoolean loadPrototypes=IlvAbstractProtoLibrary::LoadAll)=0
 Loads the prototype library from stream.
void removePrototype (IlvPrototype *prototype)
 Removes a prototype from the prototype library.
virtual IlBoolean save (ostream *stream=0, IlBoolean savePrototypes=IlvAbstractProtoLibrary::LoadAll)=0
 Saves the prototype library to stream.

Static Public Member Functions

static void SetAutoLoadMode (IlBoolean loadAll)
 Sets the default load mode of libraries.

Friends

class IlvGroup
class IlvProtoInstance
class IlvPrototype

Detailed Description

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.

Constructor & Destructor Documentation

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.

Member Function Documentation

void IlvAbstractProtoLibrary::addPrototype ( IlvPrototype prototype  ) 

Adds a prototype to the prototype library.

Parameters:
prototype Prototype to add.
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.
IlvPrototype* IlvAbstractProtoLibrary::getPrototype ( const char *  name,
IlBoolean  reload = IlFalse 
)

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.
IlvPrototype** IlvAbstractProtoLibrary::getPrototypes ( IlUInt count  ) 

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.
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.
void IlvAbstractProtoLibrary::removePrototype ( IlvPrototype prototype  ) 

Removes a prototype from the prototype library.

Parameters:
prototype Prototype to remove.
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.
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.

© Copyright 2012, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.