Condition Class Reference

AIML class that represents the AIML XML tag "condition". More...

#include <Condition.h>

Inheritance diagram for Condition:

InnerTemplate InnerCategory InnerTopic InnerAIML Tag List of all members.

Public Member Functions

virtual void add (const shared_ptr< InnerTemplate > &tag) throw (InternalProgrammerErrorException &)
 Adds the InnerTemplate AIML XML Tag object to the underlying data structure.
virtual void addCharacters (const StringPimpl &characters) throw (InternalProgrammerErrorException &)
 Creates a PlainWord object with the characters and adds it to the end of the underlying data structure.
 Condition (GraphBuilderFramework &builder) throw (InternalProgrammerErrorException &)
 Initalizes the private implementation (m_pimpl) data and sets the private implementation with a reference to the GraphBuilderFramework.
virtual StringPimpl getString () const throw (InternalProgrammerErrorException &)
 Calls GraphBuilderFramework::predicateMatch() with calculated data from Condition::setAttribute() and returns the result.
virtual bool isBlockCondition () const throw (InternalProgrammerErrorException &)
 Returns true if this is a block condition otherwise it will return false.
virtual bool isMutliPredicateCondition () const throw (InternalProgrammerErrorException &)
 Returns true if this is a multi-predicate condition otherwise it will return false.
virtual bool isSinglePredicateCondition () const throw (InternalProgrammerErrorException &)
 Returns true if this is a single predicate condition otherwise it will return false.
virtual void setAttribute (const StringPimpl &name, const StringPimpl &value) throw (InternalProgrammerErrorException &)
 Sets its attribute of "name" or "value".
virtual ~Condition ()
 Default virtual destructor.

Private Attributes

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

Detailed Description

AIML class that represents the AIML XML tag "condition".

Every time a XML Tag of AIML is encountered, an instance of this class will be created. All text inbetween the begin and end tag, all attributes, and all inner Tags will go through methods of this class.


Constructor & Destructor Documentation

Condition GraphBuilderFramework builder  )  throw (InternalProgrammerErrorException &)
 

Initalizes the private implementation (m_pimpl) data and sets the private implementation with a reference to the GraphBuilderFramework.

Parameters:
builder A reference to the graph builder framework that can be used to set and get information from the AIML engine.
Exceptions:
InternalProgrammerErrorException is thrown only if the error is so grave that the entire AIML engine has to be shut down.

virtual ~Condition  )  [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]
 

Adds the InnerTemplate AIML XML Tag object to the underlying data structure.

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 Condition::getString()
Exceptions:
InternalProgrammerErrorException is thrown only if the error is so grave that the entire AIML engine has to be shut down.

Reimplemented from InnerTemplate.

virtual void addCharacters const StringPimpl characters  )  throw (InternalProgrammerErrorException &) [virtual]
 

Creates a PlainWord object with the characters and adds it to the end of the underlying data structure.

Parameters:
characters The characters to insert into the PlainWord object.
Exceptions:
InternalProgrammerErrorException is thrown only if the error is so grave that the entire AIML engine has to be shut down.

Reimplemented from Tag.

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

Calls GraphBuilderFramework::predicateMatch() with calculated data from Condition::setAttribute() and returns the result.

Returns:
The appropriate result from calling GraphBuilderFramework::predicateMatch()
Exceptions:
InternalProgrammerErrorException is thrown only if the error is so grave that the entire AIML engine has to be shut down.

Reimplemented from InnerTemplate.

virtual bool isBlockCondition  )  const throw (InternalProgrammerErrorException &) [virtual]
 

Returns true if this is a block condition otherwise it will return false.

The blockCondition type of condition has a required attribute name, which specifies an AIML predicate, and a required attribute value, which contains a simple pattern expression.

Returns:
true if this is a block condition otherwise false
Exceptions:
InternalProgrammerErrorException is thrown only if the error is so grave that the entire AIML engine has to be shut down.

virtual bool isMutliPredicateCondition  )  const throw (InternalProgrammerErrorException &) [virtual]
 

Returns true if this is a multi-predicate condition otherwise it will return false.

The multiPredicateCondition type of condition has no attributes. This form of condition must contain at least one li element. Zero or more of these li elements may be of the nameValueListItem type. Zero or one of these li elements may be of the defaultListItem type.

Returns:
true if this is a multi-predicate condition otherwise false
Exceptions:
InternalProgrammerErrorException is thrown only if the error is so grave that the entire AIML engine has to be shut down.

virtual bool isSinglePredicateCondition  )  const throw (InternalProgrammerErrorException &) [virtual]
 

Returns true if this is a single predicate condition otherwise it will return false.

The singlePredicateCondition type of condition has a required attribute name, which specifies an AIML predicate. This form of condition must contain at least one li element. Zero or more of these li elements may be of the valueOnlyListItem type. Zero or one of these li elements may be of the defaultListItem type.

Returns:
true if this is a single predicate condition otherwise false
Exceptions:
InternalProgrammerErrorException is thrown only if the error is so grave that the entire AIML engine has to be shut down.

virtual void setAttribute const StringPimpl name,
const StringPimpl value
throw (InternalProgrammerErrorException &) [virtual]
 

Sets its attribute of "name" or "value".

Parameters:
name The name of the AIML XML attribute
value The value of the AIML XML attribute
Exceptions:
InternalProgrammerErrorException is thrown only if the error is so grave that the entire AIML engine has to be shut down.

Reimplemented from Tag.


Member Data Documentation

shared_ptr<ConditionImpl> 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 InnerTemplate.


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