clipsmm - C++ CLIPS Interface Library

clipsmm logo
template.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2006 by Rick L. Vinyard, Jr. *
3  * rvinyard@cs.nmsu.edu *
4  * *
5  * This file is part of the clipsmm library. *
6  * *
7  * The clipsmm library is free software; you can redistribute it and/or *
8  * modify it under the terms of the GNU General Public License *
9  * version 3 as published by the Free Software Foundation. *
10  * *
11  * The clipsmm library is distributed in the hope that it will be *
12  * useful, but WITHOUT ANY WARRANTY; without even the implied warranty *
13  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
14  * General Public License for more details. *
15  * *
16  * You should have received a copy of the GNU General Public License *
17  * along with this software. If not see <http://www.gnu.org/licenses/>. *
18  ***************************************************************************/
19 #ifndef CLIPSTEMPLATE_H
20 #define CLIPSTEMPLATE_H
21 
22 #include <vector>
23 
25 #include <clipsmm/value.h>
26 
27 #undef NO_DEFAULT
28 #undef STATIC_DEFAULT
29 #undef DYNAMIC_DEFAULT
30 
31 namespace CLIPS {
32 
33 typedef enum DefaultType {
34  NO_DEFAULT=0,
37 } DefaultType;
38 
42 class Template: public EnvironmentObject {
43 public:
44  typedef CLIPSPointer<Template> pointer;
45 
46  Template( Environment& environment, void* cobj=NULL );
47 
48  static Template::pointer create( Environment& environment, void* cobj=NULL );
49 
51 
53  std::string name();
54 
56  std::string module_name();
57 
58  std::string formatted();
59 
61  Values slot_allowed_values( const std::string& slot_name );
62 
64  Values slot_cardinality( const std::string& slot_name );
65 
67  DefaultType slot_default_type( const std::string& slot_name );
68 
70  Values slot_default_value( const std::string& slot_name );
71 
73  Values slot_range( const std::string& slot_name );
74 
76  bool slot_exists( const std::string& slot_name );
77 
79  bool is_multifield_slot( const std::string& slot_name );
80 
82  bool is_single_field_slot( const std::string& slot_name );
83 
85  std::vector<std::string> slot_names();
86 
88  bool is_watched();
89 
91 
92  bool is_deletable();
93 
94  void set_watch( unsigned state );
95 
96  bool retract();
97 
98  protected:
99 
100 };
101 
102 }
103 
104 #endif
CLIPS::Template::slot_names
std::vector< std::string > slot_names()
Returns the slot names associated with this template.
Definition: template.cpp:128
CLIPS::Template::formatted
std::string formatted()
Definition: template.cpp:70
template.h
CLIPS::Template::name
std::string name()
The name of this template.
Definition: template.cpp:56
CLIPS::Template::is_deletable
bool is_deletable()
Definition: template.cpp:183
CLIPS::Object::cobj
void * cobj() const
Returns a pointer to the underlying CLIPS C object.
Definition: object.cpp:50
CLIPS::Template::Template
Template(Environment &environment, void *cobj=NULL)
Definition: template.cpp:47
CLIPS::Template::set_watch
void set_watch(unsigned state)
Definition: template.cpp:189
CLIPS::Template::slot_default_value
Values slot_default_value(const std::string &slot_name)
Returns the default value for a given slot.
Definition: template.cpp:144
CLIPS::EnvironmentObject::m_environment
Environment & m_environment
Definition: environmentobject.h:58
CLIPS::Template::create
static Template::pointer create(Environment &environment, void *cobj=NULL)
Definition: template.cpp:50
CLIPS::DefaultType
DefaultType
Definition: template.h:50
utility.h
CLIPS::Template::is_watched
bool is_watched()
True is this template is being watched.
Definition: template.cpp:166
CLIPS::Template::is_multifield_slot
bool is_multifield_slot(const std::string &slot_name)
Determines whether a slot is a multifield slot.
Definition: template.cpp:110
CLIPS::data_object_to_values
Values data_object_to_values(dataObject *clipsdo)
TODO Move to utility, since these are no longer factory methods.
Definition: factory.cpp:49
CLIPS::Template::module_name
std::string module_name()
The name of the module this template is in.
Definition: template.cpp:63
CLIPS::Template::slot_cardinality
Values slot_cardinality(const std::string &slot_name)
Returns the cardinality information for a slot.
Definition: template.cpp:89
CLIPS::Template::slot_default_type
DefaultType slot_default_type(const std::string &slot_name)
Determines whether a slot has a default value.
Definition: template.cpp:138
CLIPS::EnvironmentObject::environment
Environment & environment() const
Definition: environmentobject.cpp:50
CLIPS::Template::is_single_field_slot
bool is_single_field_slot(const std::string &slot_name)
Determines whether a slot is a single field slot.
Definition: template.cpp:119
CLIPS::DYNAMIC_DEFAULT
@ DYNAMIC_DEFAULT
Definition: template.h:70
CLIPS::Values
std::vector< Value > Values
Definition: value.h:295
CLIPS::Template::~Template
~Template()
Definition: template.cpp:54
CLIPS::Template::slot_exists
bool slot_exists(const std::string &slot_name)
Determines whether a slot exists in the template.
Definition: template.cpp:101
CLIPS::Template::slot_allowed_values
Values slot_allowed_values(const std::string &slot_name)
Returns the allowed values for a given slot.
Definition: template.cpp:77
CLIPS::Template::retract
bool retract()
Definition: template.cpp:194
CLIPS::NO_DEFAULT
@ NO_DEFAULT
Definition: template.h:68
CLIPS
Definition: activation.cpp:29
environment.h
environmentobject.h
CLIPS::Template::pointer
CLIPSPointer< Template > pointer
Definition: template.h:61
CLIPS::Template::slot_range
Values slot_range(const std::string &slot_name)
Returns the range information for a slot.
Definition: template.cpp:155
CLIPS::STATIC_DEFAULT
@ STATIC_DEFAULT
Definition: template.h:69
value.h
CLIPS::Template::next
Template::pointer next()
Definition: template.cpp:172
CLIPS::data_object_to_strings
std::vector< std::string > data_object_to_strings(dataObject *clipsdo)
Definition: utility.cpp:51
CLIPS::Object::m_cobj
void * m_cobj
The underlying CLIPS C object.
Definition: object.h:79

Generated on Mon Jul 27 2020 00:00:00 for clipsmm by doxygen 1.8.18