CustomTags Class Reference

The class to inherit from when implementing a custom Tag dll or shared object. More...

#include <CustomTags.h>

List of all members.

Public Member Functions

virtual shared_ptr< TagcreateTagClass (const char *const className, GraphBuilderFramework &builder)=0 throw (InternalProgrammerErrorException &)
 Contract in which you will return a shared_ptr<Tag> of your custom Tag class when given the string of the Tag name.
virtual ~CustomTags ()
 Default virtual destructor.


Detailed Description

The class to inherit from when implementing a custom Tag dll or shared object.

Inherit from this class within your dll or shared object and flush out createTagClass to return your custom Tags. Register your dll or shared object GraphBuilder::addCustomTagLibrary()

The .dll or .so that has the custom AIML tags must conform to the proper format. The proper format is that the .dll/.so should have a class that inherits from this class. Also the two global C functions of CustomTags *rebeccaAIMLLoadCustomTags() and rebeccaAIMLRemoveCustomTags(CustomTagsImpl *customTags) must be present in your dll or shared objecct. rebeccaAIMLLoadCustomTags returns a new instance of the class that inherits from this class and rebeccaAIMLRemoveCustomTags takes a CustomTags argument and deletes the object. If both of these C functions cannot be found, the dll or shared object will not be loaded.


Constructor & Destructor Documentation

virtual ~CustomTags  )  [inline, virtual]
 

Default virtual destructor.


Member Function Documentation

virtual shared_ptr<Tag> createTagClass const char *const   className,
GraphBuilderFramework builder
throw (InternalProgrammerErrorException &) [pure virtual]
 

Contract in which you will return a shared_ptr<Tag> of your custom Tag class when given the string of the Tag name.

You will recieve the className of every Tag encountered during the parsing of AIML. For example, when the Tag <think> is encountered "think" in all lowercase will be sent to this method. Along with the name of the Tag a GraphBuilderFramework reference will be sent. This reference is the AIML engine associated with your Tag you will return. The reference is sent because a lot of AIML tags rely on it to set and retrieve information from the AIML engine during runtime.

If you do not wish to override the tag who's name is sent to this method you must return an empty shared_ptr. When the AIML engine sees that an empty shared_ptr is returned it will use its default AIML Tag.

Parameters:
className The AIML Tag string name you should return an instance of your custom AIML Tag to.
builder The AIML engine associated with your Tag you will return.
Returns:
Either your custom aiml Tag instance or an empty shared_ptr if you do not wish to override that particular AIML Tag.
Exceptions:
InternalProgrammerErrorException is thrown only if the error is so grave that the entire AIML engine has to be shut down.


The documentation for this class was generated from the following file:
Generated on Thu Sep 7 22:05:52 2006 for RebeccaAIML by  doxygen 1.4.5