InnerTemplate Class Reference

AIML XML abstract class for all the AIML XML Tag classes inside of the AIML XML "template" to inherit from. More...

#include <InnerTemplate.h>

Inheritance diagram for InnerTemplate:

InnerCategory InnerTopic InnerAIML Tag Bot Condition Date Get Id InnerTemplateListImpl Input PlainWord Random Size Star TemplateSideThat ThatStar TopicStar Version List of all members.

Public Member Functions

virtual void add (const shared_ptr< InnerTemplate > &tag) throw (InternalProgrammerErrorException &)
 Add an InnerTemplate AIML XML Tag object to the underlying data structure.
virtual StringPimpl getString () const throw (InternalProgrammerErrorException &)
 Return the results of what the AIML XML InnerTemplate Tag is suppose to return according to the AIML specification.
virtual void handleInnerTag (const shared_ptr< Tag > &tag) throw (InternalProgrammerErrorException &)
 Calls InnerTemplate::add with the Tag object.
 InnerTemplate () throw (InternalProgrammerErrorException &)
 Default constructor to initalize the private implementation (m_pimpl) data.
virtual ~InnerTemplate ()
 Default virtual destructor.

Private Attributes

shared_ptr< InnerTemplateImpl > m_pimpl
 The private implementation in which you cannot get access to.

Detailed Description

AIML XML abstract class for all the AIML XML Tag classes inside of the AIML XML "template" to inherit from.

This class adds the operations needed by AIML XML Tag classes that are inside of the <template> AIML XML tag.

If you write a AIML XML tag class such as Li, Srai, LowerCase, etc... which reside inside of <InnerTemplate> you should either inherit from this class or from another class which already inherits from this class.


Constructor & Destructor Documentation

InnerTemplate  )  throw (InternalProgrammerErrorException &)
 

Default constructor to initalize the private implementation (m_pimpl) data.

Exceptions:
InternalProgrammerErrorException is thrown only if the error is so grave that the entire AIML engine has to be shut down.

virtual ~InnerTemplate  )  [virtual]
 

Default virtual destructor.

Destroys the private implementation (m_pimpl) data.


Member Function Documentation

virtual void add const shared_ptr< InnerTemplate > &  tag  )  throw (InternalProgrammerErrorException &) [virtual]
 

Add an InnerTemplate AIML XML Tag object to the underlying data structure.

This method goes hand-in-hand with InnerTemplate::getString(). When a Inner Tag object is "added" it is put into a data structure for latter retrieval by InnerTemplate::getString(). This method is a no-ops (No operations) method and does nothing by its self. It is up to the inheriting class to determine how to add the Tag as well as latter retrieve it by InnerTemplate::getString().

For example if <think><person>blah</person></think> is encountered, the Tag object Person will be sent to the Think object through this method after the end element of Person (</person>) is encountered. It is up to the Think object's implementation of this method to "add" or keep track of the person object. When Think's Think::getString() method is called it is up to Think to retrieve and call Person's Person::getString() and retrieve the string of Person before returning Think's string.

One more example would be: <formal><person><sentence>blah</sentence></person></formal> Here when </sentence> is encountered the Person object will be sent a shared_ptr to the Sentece object through this method. Next, </person> will be encountered and the Formal object will be sent a shared_ptr to the Person object through this method. When Formal's method Formal::getString() is called, it will in turn call Person's Person::getString(). Person in turn will call Sentence's Sentence::getString(). Sentence returns to Person "blah" as "Blah" according to what the AIML XML Sentence Tag is suppose to do. The Person object gets Setence's string, transforms it according to what the AIML XML Person Tag is suppose to do and returns it to Formal. Formal's call to Person::getString() finally returns and it transforms it according to what the AIML XML Formal Tag is suppose to transform it to and returns it.

Parameters:
tag The InnerTemplate AIML XML Tag that is inside this AIML XML Tag and is to be added to this AIMl XML's underlying data structure for latter retrievel through InnerTemplate::getString()
Exceptions:
InternalProgrammerErrorException is thrown only if the error is so grave that the entire AIML engine has to be shut down.

Reimplemented in Condition, InnerTemplateListImpl, and Random.

virtual StringPimpl getString  )  const throw (InternalProgrammerErrorException &) [virtual]
 

Return the results of what the AIML XML InnerTemplate Tag is suppose to return according to the AIML specification.

This method goes hand-in-hand with InnerTemplate::add(). When this method is called the string representation of the AIML XML InnerTemplate Tag is returned. Any string transformations that are to be applied to the AIML XML InnerTemplate Tag are applied during this call. This method is a no-ops (No operations) method and does nothing by its self.

A simple example would be when the InnerTemplate <formal>blah</formal> is encountered a Formal Object is created. When Formal's method Formal::getString() is called, Formal returns the string blah tansformed into "Blah".

For more complex examples see InnerTemplate::add().

Returns:
The results of the AIM XML Tag's transformation on any text and any AIML XML InnerTemplate Tags that are inside this AIML XML Tag.
Exceptions:
InternalProgrammerErrorException is thrown only if the error is so grave that the entire AIML engine has to be shut down.

Implements InnerCategory.

Reimplemented in Bot, Condition, Date, Formal, Gender, Get, Gossip, Id, InnerTemplateListImpl, Input, Learn, LowerCase, Person, Person2, PlainWord, Random, Sentence, Set, Size, Srai, Star, System, TemplateSideThat, ThatStar, Think, TopicStar, UpperCase, and Version.

virtual void handleInnerTag const shared_ptr< Tag > &  tag  )  throw (InternalProgrammerErrorException &) [virtual]
 

Calls InnerTemplate::add with the Tag object.

First using Tag::instanceOf() it checks that the AIML XML Tag is an instance of InnerTemplate. If it is it calls InnerTemplate::add() with the object, otherwise it throws a rebecca::impl::InternalProgrammerErrorException which would shut down the AIML engine altogether.

Parameters:
tag The AIML XML Tag object to add to InnerTemplate.
Exceptions:
If Tag is not an instance of InnerTemplate this exception will be thrown and shut down the AIML engine.

Reimplemented from Tag.


Member Data Documentation

shared_ptr<InnerTemplateImpl> m_pimpl [private]
 

The private implementation in which you cannot get access to.

This shared_ptr holds the private methods and private member variables of this class. This makes ABI (Application Binary Interface) more resilient to change. See the private implementation idiom on the internet for more information about this.

Reimplemented from InnerCategory.

Reimplemented in Bot, Condition, Date, Formal, Gender, Get, Gossip, Id, InnerTemplateListImpl, Input, Learn, Li, LowerCase, NonImplemented, Person, Person2, PlainWord, Random, Sentence, Set, Size, Srai, Star, System, TemplateSideThat, ThatStar, Think, TopicStar, UpperCase, and Version.


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