00001 /*************************************************************************** 00002 * Copyright (C) 2006 by Rick L. Vinyard, Jr. * 00003 * rvinyard@cs.nmsu.edu * 00004 * * 00005 * This file is part of the clipsmm library. * 00006 * * 00007 * The clipsmm library is free software; you can redistribute it and/or * 00008 * modify it under the terms of the GNU General Public License * 00009 * version 3 as published by the Free Software Foundation. * 00010 * * 00011 * The clipsmm library is distributed in the hope that it will be * 00012 * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * 00013 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 00014 * General Public License for more details. * 00015 * * 00016 * You should have received a copy of the GNU General Public License * 00017 * along with this software. If not see <http://www.gnu.org/licenses/>. * 00018 ***************************************************************************/ 00019 #ifndef CLIPSTEMPLATE_H 00020 #define CLIPSTEMPLATE_H 00021 00022 #include <vector> 00023 00024 #include <clipsmm/environmentobject.h> 00025 #include <clipsmm/value.h> 00026 00027 #undef NO_DEFAULT 00028 #undef STATIC_DEFAULT 00029 #undef DYNAMIC_DEFAULT 00030 00031 namespace CLIPS { 00032 00033 typedef enum DefaultType { 00034 NO_DEFAULT=0, 00035 STATIC_DEFAULT=1, 00036 DYNAMIC_DEFAULT=2, 00037 } DefaultType; 00038 00042 class Template: public EnvironmentObject { 00043 public: 00044 typedef CLIPSPointer<Template> pointer; 00045 00046 Template( Environment& environment, void* cobj=NULL ); 00047 00048 static Template::pointer create( Environment& environment, void* cobj=NULL ); 00049 00050 ~Template(); 00051 00053 std::string name(); 00054 00056 std::string module_name(); 00057 00058 std::string formatted(); 00059 00061 Values slot_allowed_values( const std::string& slot_name ); 00062 00064 Values slot_cardinality( const std::string& slot_name ); 00065 00067 DefaultType slot_default_type( const std::string& slot_name ); 00068 00070 Values slot_default_value( const std::string& slot_name ); 00071 00073 Values slot_range( const std::string& slot_name ); 00074 00076 bool slot_exists( const std::string& slot_name ); 00077 00079 bool is_multifield_slot( const std::string& slot_name ); 00080 00082 bool is_single_field_slot( const std::string& slot_name ); 00083 00085 std::vector<std::string> slot_names(); 00086 00088 bool is_watched(); 00089 00090 Template::pointer next(); 00091 00092 bool is_deletable(); 00093 00094 void set_watch( unsigned state ); 00095 00096 bool retract(); 00097 00098 protected: 00099 00100 }; 00101 00102 } 00103 00104 #endif