Tag.h

00001 #ifndef REBECCA_FRAMEWORK_TAG_H
00002 #define REBECCA_FRAMEWORK_TAG_H
00003 
00004 /*
00005  * RebeccaAIML, Artificial Intelligence Markup Language 
00006  * C++ api and engine.
00007  *
00008  * Copyright (C) 2005 Frank Hassanabad
00009  *
00010  * This library is free software; you can redistribute it and/or
00011  * modify it under the terms of the GNU Lesser General Public
00012  * License as published by the Free Software Foundation; either
00013  * version 2.1 of the License, or (at your option) any later version.
00014  *
00015  * This library is distributed in the hope that it will be useful,
00016  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018  * Lesser General Public License for more details.
00019  *
00020  * You should have received a copy of the GNU Lesser General Public
00021  * License along with this library; if not, write to the Free Software
00022  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00023  */
00024 
00025 /* Disable Windows VC 7.x warning about 
00026  * shared_ptr needing dll-interface and
00027  * about it ignoring the throw specification
00028  */
00029 #ifdef _WIN32
00030 #    pragma warning ( push )
00031 #    pragma warning( disable : 4251 )
00032 #    pragma warning( disable : 4290 )
00033 #endif
00034 
00035 //rebecca includes
00036 #include <rebecca/StringPimpl.h>
00037 #include <rebecca/exports.h>
00038 #include <rebecca/Exceptions.h>
00039 
00040 //Boost includes
00041 #include <boost/shared_ptr.hpp>
00042 
00043 
00044 namespace rebecca
00045 {
00046 namespace framework
00047 {
00048 namespace impl
00049 {
00050 
00051 using namespace boost;
00052 
00053 /*
00054  * Forward declerations
00055  */
00056 
00067 class TagImpl;
00068 
00077 class REBECCA_EXPORT Tag
00078 {
00079 
00080     public:
00081 
00091         Tag() 
00092             throw(InternalProgrammerErrorException &);
00093         
00118         virtual void addCharacters(const StringPimpl &characters) 
00119             throw(InternalProgrammerErrorException &);
00120 
00142         virtual void handleInnerTag(const shared_ptr<Tag> &tag) 
00143             throw(InternalProgrammerErrorException &); 
00144 
00161         virtual void setAttribute(const StringPimpl &name, const StringPimpl &value) 
00162             throw(InternalProgrammerErrorException &);
00163         
00199         bool instanceOf(const char * const instance) 
00200             throw(InternalProgrammerErrorException &);
00201 
00206         virtual ~Tag();
00207 
00208     protected:
00209 
00228         void addInstanceOf(const char * const instance) 
00229             throw(InternalProgrammerErrorException &);
00230 
00231     private:
00232 
00243         shared_ptr<TagImpl> m_pimpl;
00244 
00253         Tag &operator=(const Tag &tag);
00254 
00264         Tag(const Tag& tag);
00265 
00266 
00267 };
00268 
00269 } //end of namespace impl
00270 
00271 //Expose just the class name to the framework namespace
00272 using rebecca::framework::impl::Tag;
00273 
00274 /* 
00275  * Expose the rebecca namespace to the framework namespace.
00276  * Since all the tags include this file, they will all
00277  * get the rebecca namespace also.
00278  */
00279 using namespace rebecca;
00280 
00281 } //end of namespace framework
00282 } //end of namespace rebecca
00283 
00284 #ifdef _WIN32
00285 #    pragma warning ( pop )
00286 #endif
00287 
00288 #endif

Generated on Thu Sep 7 22:05:46 2006 for RebeccaAIML by  doxygen 1.4.5