template.h

00001 /***************************************************************************
00002  *   clipsmm C++ wrapper for the CLIPS c library                           *
00003  *   Copyright (C) 2006 by Rick L. Vinyard, Jr.                            *
00004  *   rvinyard@cs.nmsu.edu                                                  *
00005  *                                                                         *
00006  *   This program is free software; you can redistribute it and/or modify  *
00007  *   it under the terms of version 2 of the GNU General Public License as  *
00008  *   published by the Free Software Foundation.                            *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU Lesser General Public      *
00016  *   License along with this library; if not, write to the                 *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA              *
00019  ***************************************************************************/
00020 #ifndef CLIPSTEMPLATE_H
00021 #define CLIPSTEMPLATE_H
00022 
00023 #include <vector>
00024 
00025 #include <clipsmm/environmentobject.h>
00026 #include <clipsmm/value.h>
00027 
00028 #undef NO_DEFAULT
00029 #undef STATIC_DEFAULT
00030 #undef DYNAMIC_DEFAULT
00031 
00032 namespace CLIPS {
00033 
00034 typedef enum DefaultType {
00035   NO_DEFAULT=0,
00036   STATIC_DEFAULT=1,
00037   DYNAMIC_DEFAULT=2,
00038 } DefaultType;
00039 
00043 class Template: public EnvironmentObject {
00044 public:
00045   typedef CLIPSPointer<Template> pointer;
00046 
00047   Template( Environment& environment, void* cobj=NULL );
00048 
00049   static Template::pointer create( Environment& environment, void* cobj=NULL );
00050 
00051     ~Template();
00052 
00054     std::string name();
00055 
00057     std::string module_name();
00058 
00059     std::string formatted();
00060 
00062                 Values slot_allowed_values( const std::string& slot_name );
00063 
00065     Values slot_cardinality( const std::string& slot_name );
00066 
00068     DefaultType slot_default_type( const std::string& slot_name );
00069 
00071     Values slot_default_value( const std::string& slot_name );
00072 
00074     Values slot_range( const std::string& slot_name );
00075 
00077     bool slot_exists( const std::string& slot_name );
00078 
00080     bool is_multifield_slot( const std::string& slot_name );
00081 
00083     bool is_single_field_slot( const std::string& slot_name );
00084 
00086     std::vector<std::string> slot_names();
00087 
00089     bool is_watched();
00090 
00091     Template::pointer next();
00092 
00093     bool is_deletable();
00094 
00095     void set_watch( unsigned state );
00096 
00097     bool retract();
00098 
00099   protected:
00100 
00101 };
00102 
00103 }
00104 
00105 #endif

Generated on Sun Nov 12 11:55:35 2006 by  doxygen 1.5.1