#include <Tag.h>
Inheritance diagram for Tag:
Public Member Functions | |
virtual void | addCharacters (const StringPimpl &characters) throw (InternalProgrammerErrorException &) |
Characters inbetween AIML XML begin tags and end tags are added through this method. | |
virtual void | handleInnerTag (const shared_ptr< Tag > &tag) throw (InternalProgrammerErrorException &) |
Whenever a AIML XML end tag is reached, it will be sent as an argument to its parent or outermost AIML XML tag. | |
bool | instanceOf (const char *const instance) throw (InternalProgrammerErrorException &) |
Determines if the AIML XML tag object inherits from another AIML XML tag class somewhere in the hierarchy. | |
virtual void | setAttribute (const StringPimpl &name, const StringPimpl &value) throw (InternalProgrammerErrorException &) |
Attributes of the AIML XML tags will be sent through this method. | |
Tag () throw (InternalProgrammerErrorException &) | |
Default constructor to initalize the private implementation (m_pimpl) data. | |
virtual | ~Tag () |
Default virtual destructor. | |
Protected Member Functions | |
void | addInstanceOf (const char *const instance) throw (InternalProgrammerErrorException &) |
Whenever a AIML XML tag inherits from any AIML XML tag it should absolutely use this method in its constructor to add its class name. | |
Private Member Functions | |
Tag & | operator= (const Tag &tag) |
The assignment operator. | |
Tag (const Tag &tag) | |
The copy constructor. | |
Private Attributes | |
shared_ptr< TagImpl > | m_pimpl |
The private implementation in which you cannot get access to. |
This class contains the methods in which every AIML XML could have. It also cotains utility methods in which every XML AIML tag could use.
|
Default constructor to initalize the private implementation (m_pimpl) data.
|
|
Default virtual destructor. Destroys the private implementation (m_pimpl) data. |
|
The copy constructor. For now, I am not allowing this to be invoked. The tags shouldn't be allowed to be copied amongst themselves.
|
|
Characters inbetween AIML XML begin tags and end tags are added through this method. Whenver a xml tag has characters inbetween them such as <srai>blah</srai> the words such as blah will be sent to this method. There's no guarantee that all the characters inbetween the tags will be sent all at once. It could be the case that one word at a time will be sent, or two at a time, or all at a time. But they will be sent in correct order from left to right. Not all AIML XML tags have character data inbetwen the begin and end tags. Those classes will not implement this method. When not implemented this method is a no-operations method. It does nothing when not implemented.
Reimplemented in Condition, Gender, InnerTemplateListImpl, Pattern, PatternSideThat, Person, Person2, and Template. |
|
Whenever a AIML XML tag inherits from any AIML XML tag it should absolutely use this method in its constructor to add its class name. For example since Srai inherits from another AIML XML tag it inherits this method. It calls this method in its constructor to add its name as in addInstanceOf("Srai"). The method Tag::instanceOf will not operate correctly if you do not call this method within your constructors of AIML Tags.
|
|
Whenever a AIML XML end tag is reached, it will be sent as an argument to its parent or outermost AIML XML tag. As an example look at this InnerTemplate, <think><srai>blah</srai></think>. When the Srai end tag is reached, </srai>, the entire Srai tag object will be sent as an argument to handlerInnerTag on the Think object. This gives the outermost tag/parent tag an opportunity to handle each inner tag/child tag. Not all AIML XML tags need to handle inner AIML XML tags. When not implemented this method is a no-operations method. It does nothing when not implemented.
Reimplemented in AIML, Category, InnerTemplate, Template, and Topic. |
|
Determines if the AIML XML tag object inherits from another AIML XML tag class somewhere in the hierarchy. Use this in conjuction with static_cast<> to downcast AIML XML tags safetly as well as to determine if the AIML XML tag is an instance of another AIML XML tag. This only works if the object registered its self with Tag::addInstanceOf. All AIML XML tags in the framework should use Tag::addInstanceOf to guarantee this. Sometimes you get an AIML XML tag object in an argument in a method such as Tag::handleInnerTag in which you need to downcast it. Instead of blindly downcasting to what the AIML XML tag you think you should have recieved you can use this method first to determine if it is indeed an instance of that AIML XML tag. If it is, then you can safetly downcast it using static_cast<>. I use this method in conjunction with static_cast as a replacement for dynamic_cast<>. dynamic_cast<> is not guaranteed to work across dll boundaries and thus it cannot be used with custom framework dll's. You SHOULD NEVER USE dynamic_cast<> with RebeccaAIML since it is a dll. You should always use this method in conjunction with static_cast<> for all your downcasting needs.
|
|
The assignment operator. For now, I am not allowing a copy to be made. The tags shouldn't be copied amongst themselves.
|
|
Attributes of the AIML XML tags will be sent through this method. As an example, <get name="blah"> will set name to "name" and value to "blah". Not all AIML XML tags have attributes. When not implemented this method is a no-operations method. It does nothing when not implemented.
Reimplemented in AIML, Bot, Condition, Get, Input, Li, Set, Star, TemplateSideThat, ThatStar, Topic, and TopicStar. |
|
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 in AIML, Bot, Category, Condition, Date, Formal, Gender, Get, Gossip, Id, InnerAIML, InnerCategory, InnerTemplate, InnerTemplateListImpl, InnerTopic, Input, Learn, Li, LowerCase, NonImplemented, Pattern, PatternSideThat, Person, Person2, PlainWord, Random, Sentence, Set, Size, Srai, Star, System, Template, TemplateSideThat, ThatStar, Think, Topic, TopicStar, UpperCase, and Version. |